Вы находитесь на странице: 1из 104

..

( )

2003

-2-

IV-V , ()
(),
(
, .. InterNet). IBM PC WINDOWS ( WINDOWS c
NT), .
( NetBIOS,
RPC, Windows Sockets .),
,
, , InterNet.

Visual C++ Microsoft C++Builder Borland Int. ( Inprise Corp.) 32-
WINDOWS.
- IBM PC i586 64128 b, 4-6 Gb, VGA
- ( ) /
( InterNet ).
http://pilger.mgapi.edu/methods/nets.zip.
: , ... ..
: ..
: , ... ..

-4 _______ 2003 .
-4 , ...

..

. -.: , 1999, -88 .

-3-

......................................................................................................
1. ...............................................................................................
2. ....................................................................................
2.1. ............................................................................
2.2. ................................................................................
2.3. OSI..........................................................................
2.4. , ......
2.4.1. ....
2.5.- ...........
2.6. ...................
3.
................................................................
3.1. ...............
3.2. ,
.......................................................
3.3. ...................................
3.4. ..............
4. /.................... ........
5. .....................................................................
6. , .....................................................
6.1. ................
6.2. ...................................................
6.3. .................................................................................
6.4. ..............................................................................
6.5. ..................................................................
6.6. ......................................................................
6.6.1. .........................................................................
6.6.2. ........................................................................
6.7. ................................................................
7. InterNet....................................................................
7.1. InterNet.........................
7.1.1. InterNet..........................................
7.2. InterNet.....................
7.2.1. HTML .............
7.2.2. Java InterNet..................
7.2.3. JavaScript, VBScript PerlScript...................................
7.2.4. CGI ISAPI......................................
7.3. InterNet............................................
7.4. InterNet........................................
8. .........................................

-4-

8.1. ............................................................................
8.2. ...........................................................
8.3. ................................................................................................
...................................................................................................
.........................................................

,
[1]. ,
(
Norton Commander DOS
), . , ( ) ,
/ . ,

( , ) .
(
), (
, .) [2]. , .
( ) - (
) . , (.. ) [5]. , ( , .)
. , WindowsNT (
,
, ).

-5-

( , - ), (c
).
, , Compaq Santa
Cruz Operation ( ) Compaq
ProLiant Clusters for SCO UnixWare ver.7.1, ProLiant ( )
; ( 2 6 ) , ()
( ).

(
) .
1.

(
, , ).
, ; .
WindowsNT 4.0 5.1 (WXP). ( ), (, .) WindowsNT POSIX - UNIX (Portable Operating System Interface
based on uniX).
POSIX ( IEEE 1003.1-1988) , UNIX- , ,
.

-6-

WINDOWS - UNIX
UNIX POSIX.
2.
2.1.
- , ( ) . (), (
), ( ).
- , .
( ) .
() - (
/ );
( ) , -
[3].
- ,
TCP/IP InterNet, InterNet , ;
() .
- ,
- .
(workgroup) - ,
.
(domain) -
, WINDOWS NT Server
; .
(host) - ( ),
(, InterNet host 32- , .
7.1.1).

-7-


(bps - bit per second) (boud).
(traffic) - , (, , ).
- ( ) , .
- - , , .
- ,
, (
) -.
- (
), .
- , ( ) - ( ).
() - ,
( ) .
(topology) - .
-
, ( ) () , ( , - ). , , ( ).
- ()
() .
() - ,
( - ).
2.2.
,
.
,
() ( -

-8-

9600 ). ( , )
[1].

.
- (
- ); ( .. )
.
( ) - (,
- , ).

. ( )
InterNet.

,
- (
).
3 .
2.3. OSI

( -)
, ,
. . (,
N X Y) ,
, Y
. - , . , , .

-9-

.
,
(ISO, International Standart Organization) 1984 . - Open Systems
Interconnection (OSI) reference model [1,2,5] . OSI
, .2.1.
-

7.APPLICATION ( )
6.PRESENTATION ( )

7.APPLICATION
( )
6.PRESENTATION
( )

5.SESSION
( )
4.TRANSPORT ( )
3.NETWORK
( )

2.DATA-LINK
( )
1.PHYSICAL
( )

5.SESSION
( )
4.TRANSPORT
( )
3.NETWORK
( )
2.DATA-LINK
( )
1.PHYSICAL
( )

c
.2.1. OSI.
OSI - ,
, . ,
( ) (.. , .2.1).
() ( ),
,
. ,

- 10 -

,
(protocol stack). .
, , . ()
OSI.
. ( ,
). -
.
. (
, / - CR/LF)
- CR; .
. ( , , ).
.
, . , .
. , . - , (..
),
, .
. , , .
. ( )
( ).
1 2 ( )
; 3, 4, 5 , , .
- . ( -

- 11 -

- , ) 5 (), 6 ( ).
, 7 ().
, OSI
(,
). , .
.2.2 WindowsNT, OSI
[5].

.2.2. WindowsNT,
OSI .

2.4. ,

, ,
.

- 12 -

, (Ethernet,
Token-Ring, ARCnet ..), (, , .. ) , ( ) (XNS, IP/TCP ..),

.
,
.
, Microsoft Corp. [5,9] :
NetBEUI (NetBios Extended User Interface transport) - ,
NetBIOS Microsoft Corp.
TCP/IP (Transmission Control Protocol / Internet Protocol
transport) - ,

. TCP/IP UNIX
WINDOWSNT UNIX.
[13], TCP/IP
, -
IP (Internet Protocol)
TCP
(Transmission Control Protocol), TCP/IP () - , IPX, NetBIOS, ARP (Address
Resolution Protocol) ICMP
(Internet Control Message Protocol). TCP/IP- Ethernet, TCP/IP-
HTTP.
SLIP (Serial Line Internet Protocol)
TCP/IP .
.
SLIP c , ,
, [6].
PPP (Point-to-Point Protocol)
SLIP; PPP ,

- 13 -

(DNS, Domain Names Service , . 7),



[6].

Microsoft Corp.

IPX/SPX (Internet Packet eXchange / Sequest Packet eXchange) -


,
NetWare Novell Corp. [3,10].
DECnet - Digital Equipment Corp.
, WindowsNT
DECnet.
AppleTalk - Apple Corp., Inc WINDOWSNT Apple Macintosh.
XNS (Xerox Network Systems) - ,
Xerox Corp. Ethernet.
InterNet [6] :
TIME - ,
.
FTP (File Transfer Protocol), 70-
, ( PC DOS ); , ..
( ) .
SMTP (Simple Mail Transfer Protocol) 1980
(mainframe ), (
, ) .
NNTP (Network News Transfer Protocol) - , .
POP (Post Office Protocol) 1984 SMTP -
( ) (
). , POP3, , .
SMTP POP ASCII .

- 14 -

MIME (Multipurpose Internet Mail Extension) 1992 SMTP POP (, .); ( UNIX)
ASCII UUEncode
UUDecode FidoNet.
HTTP (HiperText Transfer Protocol) -
InterNet [6,13]; HTTP HTTP
www.ics.uci.edu/pub/ietf/http.

RFC (Request For Comment)
www.cis.ohio-state.edu/htbin/rfc (, TIME, SLIP PPP
RFC868, RFC1055 RFC1171 , RFC1251 RFC1252 MIME, RFC1867
HTML- ..), InterNet PROTOCOL WINDOWS.
,
. () (
) ;
(
RFC).
, 1.1 HTTP.
WEB-. HTTP
1.1 RFC-2068 HTTP 1.0 , . , ,

. HTTP 1.1
TCP-, HTTP 1.0. 1.0
TCP- HTML-, HTTP 1.1 TCP, .
HTTP 1.1 . ,
,
.
HTTP 1.1 .
. HTTP 1.1
WEB- .

- 15 -

(,
InterNet ).
W3 HTTP-NG (Next Generation),
, , HTTP. HTTP-NG
:

HTTP-NG .
,
.
, HTTPNG InterNet.
, HTTP-NG HTTP.
. , HTTP
. , . HTTP-NG
.

, (. 3.2),
(. 8.2).
2.4.1.

FTP, SMTP, POP, NNTP HTTP, ( ..
) [6].
FTP , FTP.EXE (
/SYSTEM WINDOWS).
FTP
( \r\n C), .
( .),
,

- 16 -

, .
() FTP ( )

CWD - . c :
CWD \r\n

: 250, 421, 500, 501, 530, 550 (


).
CDUP - .
CDUP \r\n

: 200, 421, 500, 501, 530, 550.


PASS - .
PASS \r\n

: 202, 230, 32, 421, 500, 501, 520.


TYPE - - A (ASCII) I (Image).
TYPE _ \r\n

: 200, 421, 500, 501, 504, 530.


LIST - ( ) ( - ASCII).
LIST [] \r\n

: 125, 150, 226, 250, 421, 425, 426, 450, 451,


500, 501, 502, 530.
MKD - (
).
MKD [] \r\n

: 257, 421, 500, 501, 502, 530, 550.


RETR - .
RETR _ \r\n

: 110, 125, 150, 226, 250, 421, 425, 426, 450,


451, 500, 501, 502, 530, 550.
HELP - .
HELP [_] \r\n

: 211, 214, 421, 500, 501, 502.


QUIT - .
QUIT \r\n

: 222, 500.
FTP 40 ,

- 17 -

200
202
421
500
501
502
530
550

OK ( )

,
,



(
)

FTP, SMTP, POP, NNTP HTTP (, , 3 - HEAD, GET,


POST) , .
( ) RFC ( HTTP InterNet-
www.w3c.org, info.cern.ch www.ics.uci.edu).
2.5.-

- ( )
(, ) , ( );
.
, - -
, () .
- [2,5,7].
, -
,
: , , . (server)
, , - (client). ( ) , ,
. ( ), ; ,

- 18 -

.
-
-
, , (, , )
.
WINDOWS
Microsoft Corp.
,
, - .
, (
) .
WindowsNT
( )
( ) (DDE, Dynamic Data Exchange); (DCOM,
Distributed Component Object Model). DCOM
, ,
( );
, ( );
OLEnterprise Inprise Corp. [7].
WindowsNT
(LPC, Local Procedure Call) - NT (RPC, Remote Procedure Call) - ( RPC OLEnterprise).
WindowsNT
(
, ) -
, Mailslot [14].
, WindowsNT
, - Microsoft Corp. , (
) .

- 19 -

2.6.


( , , , ., [24]),
15
( 10 Flops) . . ( ) ( , );
. [24].

Intel Pentium IV-V, i860,
DEC Alpha,
. Cray T3D/T3E ( 2000 , . www.cray.com). (,
www.jscc.ru) MBC 1000M (189- Top500
12
2003 ., www.top500.org) 10 Flops
(384 c 2,7 GFlops double-; 2
Alpha 21264A, 667 MHz L2 - 4 b, 2 Gb , 20 Gb; Myrinet 2000 c 2 Gbit/sec
Fast Ethernet 100 Mbit/sec).

; (
MPI - Message Passing Interface, www.mpiforum.org).
- (, , ) (
InterNet).
SETI@home
(Search
for
Extraterrestrial
Intelligence,
setiathome.ssl.berkeley.edu, 4 . ), Distributed.net (www.Distributed.net), GIMPS (Great Inter-

- 20 -

net Mersenne Prime Search, mersenne.org), Globus (www.globus.org); . [24], 7.4 .


3.

3.1.


( -) , , . ,
( ), (,
- .. ).
; .
Microsoft MS-DOS 3.1;
FAT , MS-DOS .
1984 MS-DOS 3.1 Microsoft
Microsoft Networks, MS-NET.
MS-NET de-facto , Microsoft LAN Manager (
Microsoft LAN Manager , ,
, , MS-DOS, OS/2 UNIX, WindowsNT).
,
- , MS-NET
MS-NET, (redirector). MS-NET
( - - redirect) .
MS-NET SMB
(Server Message Block), . SMB
API (Application Program
Interface) NetBIOS (NetBIOS interface); SMB API NetBIOS , WindowsNT.

- 21 -

, MS-NET -
(network server) - , - ( ).

SMB, , (, ),
SMB.
MS-NET (
) (,
NET USE X: \\SERVER\SHARE);
\\ (UNC, Uniform Naming
Convention).

NetWare Novell, ( ) C. NetWare
, MS-DOS, Windows, OS/2, UNIX, Mac System 7
., (, ).
NetWare (SFT,
System Fault Tolerant)
1. ( ).
2. (
- ) (
- , , ). , ,
( ).
3. ( ).
NetWare
( ) WindowsNT.
NetWare
(,
- ),
() NetWare .

- 22 -

NetWare WindowsNT .
NetWare 4.1 Netware Directory Service (NDS),
, WindowsNT , . . , , . NDS, , ,
,
( , , ).

NetWare WindowsNT Server; NetWare ,
WindowsNT - (, ) .
OC IBM PC-
Windows ( 80% 200 . IBM PC
) . /++ DLL- , .
WindowsNT - ( OSI );
[2,5].
.3.1 -
WindowsNT, ( , ) .
.3.2 SMB (Server Message Block);
SMB-
NetBIOS (NetBIOS interface).
Microsoft Corp. 21
NT Windows XP ( NT5.1), Windows Windows9x MILLENNIUM; ,
Universal Plug and Play
WEB (, ,

- 23 -

Windows98 ). Whistler . , Unix- .


, , () ,
( )
.

.3.1. - WindowsNT ( 16- Windows MS-DOS ).

,
-

- 24 -

( , ),
([4] .).

.3.2.
SMB WindowsNT.

()
\\__\___\_

- (mapping) (
),
( ) ,
.

- 25 -

()
7.

(,
Oracle, ).
3.2.
,


, .
ping,
tracert, netstat, route, arp, hostname, ipconfig, nbtstat, netstat .

(- ,
,

).

(
).
LANalyzer for NetWare, LANalizer for
Windows LANTEST ( Novell), SysInfo (Symantec) . [3,4].
- , , (
) (
).
( )
(, sniffer - ) - , ; , , ( ). , SpyNet (simik.lgg.ru/spynet312.exe);
WindowsNT 4.0 Server Network Monitor ( Network Monitor Tools & Agent). (
)

- 26 -

( , .
www.ice.ru/libertarium/sorm).

COMNET III ( CACI Products Company, www.caciasi.com)
OPNET(OPNET, www.mil3.com).
- (, MODSIM
SIMSCRIPT) c ; . , , , , ;
,
, .
NetSuit Advanced Professional ( NetSuit Development);
,
.
3.3.

(. 2.4); , ( , ).
(-, ,
RFC-) ;
-
( - ),

[8].
- ,

() , .

- (.. ), - , (.. ).

- 27 -


ESTELLE (Extended State Transition Language), - LOTOS
(Language of Temporal Ordering Specification); (ISO)
[8].
ESTELLE (1983 .) (
) Pascal;
LOTOS (1984 .) .
- ( ) ( ,
1983 .),
.
(
). OCA , ,
, ( RPC
WindowsNT).
, FAPL (Format and Access Protocol Language, 1978),
PANDORA (Protocol Analysis, Design and OpeRation Assesment, 1982), PDIL
(Protocol Description and Implementation Language, 1982), ( , 1985) . [8].
,
(
) , () (IMP - Interface Message Processor).
3.4.

() , .
, , ()
( )

; ( ) -

- 28 -

(
).
, 70-

(DARPA), - ARPANET;
InterNet.
,

, . ,
ARPANET 1975
100 , ( )
, ARPANET

.
ILLIAC IV (
) IMP.
ARPANET , , IMP
IMP ,
IMP- [9].
, ( ARPANET TELNET),
(DATAPAC), (EPSS), (EIN), (TRANSPAC),
, , .
ARPANET . - ( ). ;

( -

- 29 -

),
.
.3.3 ,
.

.3.3. ()
() ()
().

( ) :

(.. -) - ( ) ( ).
(.. -) -
- ( , ).
( /-) -
.

- (.3.1, 3.2,
3.3).

- 30 -

.3.5
; ,
( ). .3.5 ( ) .

.3.4. () ARPANET (
1975 ).

, .

, ( ) .

.3.5. () ().

( - )

- 31 -

(
- ) (/-); ( ) ( ) - .
[9],
1. .
2. , .
3. .
4. .
5. .
6.
IMP.

. , , ,
.

ARPANET; ,
,
, ( ),
ARPANET .
[9];
. , InterNet.
, , (
) . ,
Inprise Corp. [7], );
( ). InterNet ( ) MPLS (MultiProtocol Label
Switching - ),

- 32 -

ATM- (Asynchronous
Transfer Mode - ,
- cells ; ATN
- , , ).
4. /
/ (NetBIOS) Microsoft Corp. , - . NetBIOS,
, [11].

(NetBEUI, NetBios Extended User Interface transport)
IBM NetBIOS Microsoft
Corp; NetBEUI WindowsNT.
, , (, ) [5].
NetBIOS , NetBIOS- (, NetBEUI). NetBIOS ().
(NCB, Network
Control Block) (SMB, Server Message
Block); NetBIOS
(, ).
NetBIOS
, (
, NetBIOS
programmer reference IBM Corp.).
5.

- 33 -

(RPC, Remote Procedure Call) , ,


( ), -
. , RPC
, , (
), .
-.
WindowsNT , -. , ( ). . , - .
PRC [5]. RPC , - , (.5.1).
RPC
, RPC , - (.5.2).
RPC ,
, - ,
, , .. - RPC WindowsNT .

- 34 -

.5.1. , .

RPC () , , . ,
( , .)
(,
- CRAY) - , , -.
RPC . , () .
DLL, - (stub
procedure) . -
, ,

(marsaling) .

- 35 -

.5.2. RPC, .

, (,
, ).
RPC (Run Time); ,
, ( ). (
) RPC, ,
.
. .5.3
RPC .
, RPC
Microsoft Corp. MIDL (Microsoft Interface Definition
Language - Microsoft).

- 36 -

MIDL RPC.
(, C C++), , (,
, , , ).

(IDL, Interface Definition Language).

.5.3. RPC .

IDL MIDL, - ,
. - . , .
RPC,
RPC .

- 37 -

RPC
RPC
(RPC transport interface). RPC , RPC
, .
RPC WindowsNT DLL-
, NetBIOS, TCP/IP
DECnet, DLL . RPC
( DLL RPC WindowsNT ).
RPC RPC
RPC.
Microsoft RPC RPC, Open Software
Foundation (OSF) (DCE,
Distribute Calculation Environment). , Microsoft RPC
, DCE.
WindowsNT
RPC , . ,

, ,
, ( ).
- (ARPC,
Asynchronous Remote Procedure Cal),
(call-back function)
. RPC NetBIOS, Windows Sockets
(, WindowsNT).
, ,
, (LPC, Local Procedure Call)
(LRPC, Lightweight Remote Procedure Call).
WindowsNT.
, , Microsoft
RPC-, (
), . ,

- 38 -

, IDL. RPC-, , (
) ( ) .
dotNet
Microsoft Corp. (
)
( . 7.2.2).
6.,

- [13].

( ) ,
.
UDP (User Datagram Protocol),
TCP/IP, IPX, Novell NetWare.
,
, ,
.

.
, . , , . , , SPX (
NetBIOS ,
).

,
. , (University of California at Berkeley Sockets API)
Berkeley UNIX). .

- 39 -

(file handle),
. , , , , .
Mailslot (
++) [14].
6.1.


WSOCK32.DLL,
Windows Sockets Microsoft Windows9x
WindowsNT.
WSAStartup, :
int
WSAStartup(WORD wVersionRequested,
LPWSADATA lpWSAData);

wVersionRequested Windows Sockets, . (minor version), -


(major version).
WSAStartup lpWSAData WSADATA,
Windows Sockets.
WSAStartup .
,

WSASYSNOTREADY
WSAVERNOTSUPPORTED
WSAAEINVAL


Windows Sockets
DLL-, Windows
Sockets, , wWersionRequested

[13] SERVER, Windows


Sockets:

- 40 -

rc = WSAStartup(MAKEWORD(1,1), &WSAData);
if (rc)
{
MessageBox(NULL, " WSAStartup", "Error", MB_OK);
return (FALSE);
}
// Windows
// Sockets StatusBar
wsprint(szTemp, " %s %s",
WSAAData.szDescription,
WSAData.szSystemStatus);
// StatusBar szTemp
hwndSd = CreateStatusWindow(WS_CHILD | WS_VISIBLE |
WS_BORDER | SBARS_SIZEGRIP,
szTemp, hWnd, IDS_STATUSBAR);

Microsoft Windows9x WindowsNT


3.51 Windows Sockets 1.1, WSAStartup.

WSADATA LPWSADATA :
typedef struct WSAData
{
WORD wVersion;
WORD wHighVersion;
char szDescription[WSADESCRIPTION_LEN+1];
char szSystemStatus[WSASYS_STATYS+1];
unsigned short iMaxSockets;
unsigned short iMaxUdpDg;
char FAR *lpVendorInfo;
} WSADATA;
typedef WSAData FAR *LPWSADATA;

szDescription szSystemStatus WSAStartup Windows Socket


.
wVersion wHighVersion
Windows Socket, ,

- 41 -

, Windows Socket.
, ,
.
iMaxSockets , . iMaxUdpDg , UDP; lpVendorInfo , - Windows Sockets.
,
, Windows
Sockets.
WSACleanup, :
int
WSAlnup(void);

SOCKET_ERROR .
WSAGetLastError:
int
WSAGetLastError(void);

WSAGetLastError Windows
Socket. , .
WSACleanup,
WSAGetLastError

WSANOTINITIALISED
WSAENETDOWN
WSAEINPROGRESS

Windows Sockets WSAStartup



WSACleanup
Windows
Sockets

WSAEINPROGRESS.

- 42 -

Windows Sockets , .. . (, Windows95x WindowsNT) ,


Windows Sockets
.
6.2.
Windows Sockets
, .
socket, :
SOCKET
socket(int af, int type, int protocol);

af .
AF_INET, ,
InterNet. type rtl
, ,


SOCK_STREAM
SOCK_DGRAM


TCP

UDP

protocol,
.
socket ( SOCKET),

; , (
) (, ).

socket

INVALID_SOCKET. WSAGetLastError,

- 43 -


WSANOTINITIALISED
WSAENETDOWD
WSAEAFNOSUPPORT
WSAEINPROGRESS
WSAEMFILE
WSAENOBUFS
WSAEPROTONOSUPPORT
WSAEPROTOTYPE
WSAESOCKNOSUPPORT

Windows Sockets WSAStartup





Windows Sockets




,
TCP
srv_socket = socket(AF_INET, SOCK_STREAM, 0);
if (srv_socket == INVALID_SOCKET)
{
MessageBox(NULL, " ", "Error", MB_OK);
return;
}

WSAGetLastError .
6.3.
, , closesocket
int
closesocket(SOCKET sock);



WSANOTINITIALISED
WSAENETDOWN

closesocket
WSAStartup

- 44 -

WSANOTSOCK
WSAINPROGRESS
WSAEINTR


Windows
Sockets

WSACancelBlockingCall

6.4.
, sockaddr,
struct sockaddr
{
u_short sa_family;
char
sa_data[14];
};
typedef struct sockaddr
SOCKADDR;
typedef struct sockaddr
*PSOCKADDR;
typedef struct sockaddr FAR *LPSOCKADDR;

InterNet
, sa_data
struct sockaddr_in
{
short
sin_family;
u_short sin_port;
struct in_addr sin_addr;
char
sin_zero[8];
};
typedef struct sockaddr_in
SOCKADDR_IN;
typedef struct sockaddr_in
*PSOCKADDR_IN;
typedef struct sockaddr_in FAR *LPSOCKADDR_IN;

sin_family . AF_INET, , InterNet


( srv_address SOCKADDR_IN)
srv_address.sin_family = AF_INET;

sin_port ,
. - , -

- 45 -

. , .
sin_port
. ,
Intel, - ( Intel
).
C ,
.
Windows Socket
. , sin_port
htons, 16-
Intel .
, sin_port
SERVER, [13]
#define SERV_PORT 5000
srv_address.sin_port = htons(SERV_PORT);

sin_addr sockaddr_in
in_addr
struct in_addr
{
union
{
struct { u_char s_b1, s_b2, s_b3, s_b4; } S_un_b;
struct { u_short s_w1, s_w2; } S_un_w;
u_long S_addr;
S_un;
}
};
#define
#define
#define
#define
#define
#define

s_addr
s_host
s_net
s_imp
s_impno
s_lh

S_un.S_addr;
S_un.S_un_b.s_b2;
S_un.S_un_b.s_b1;
S_un.S_un_w.s_w2;
S_un.S_un_b.s_b4;
S_un.S_un_b.s_b3;

I
(32- , ,

- 46 -

IP- . 7.1.1), . (,
, ).

srv_address.sin_addr.s_addr = INADDR_ANY;

, IP-
(, -, IP),
IP-.
UDP .
INADDR_BROADCAST.
, ( ),
inet_addr ( dest_sin
SOCKADDR_IN)
dest_sin.sin_addr.s_addr = inet_addr("200.200.200.201");

INADDR_NONE,
.
IP inet_ntoa,
char FAR *
inet_ntoa(struct in_addr in);

NULL.
, DNS HOSTS (. 7.1.1). gethostbyname, IP,
sin_addr
PHOSTENT phe;
phe = gethostbyname(ftp.microsoft.com);
if (phe == NULL)
{
closesocket(srv_socket);
MessageBox(NULL, " GetHostByName",

- 47 -

"Error", MB_OK);
return;
}
memcpy((char FAR *) & (dest_sin.sin_addr), phe->h_addr, phe->h_length);

gethostbyname NULL,

WSAGetLastError.
DNS HOSTS (. 7.1.1), gethostbyname
hostent,
struct hostent
{
char FAR *h_name;
char FAR *FAR *h_aliases;
short h_addrtype:
short h_lenght;
char FAR *FAR *h_addr_list;
#define h_add r h_addr_list[0];
};

//
//
//
//
//
//

typedef struct hostent


*PHOSTENT;
typedef struct hostent FAR *LPHOSTENT;

h_addr_list[0],
h_addr, h_length.
6.5.
SOCKADDR (
- , )
bind
int
bind(SOCKET sock, const struct sockaddr FAR *addr, int namelen);

sock socket
, addr SOCKADDR, namelen - .

bind

SOCKET_ERROR,

- 48 -

WSAGetLastError,

WSANOTINITIALISED
WSAENETDOWN
WSAEADDRINUSE
WSAEFAULT
WSAINPROGRESS
WSAEAFNOSUPPORT
WSAEINVAL
WSAENOBUFS
WSAENOTSOCK

WSAStartup


namelen
sockaddr
Windows
Sockets



bind
if (bind(srv_socket, (LPSOCKADDR) &srv_address,
sizeof(srv_address)) == SOCKET_ERROR)
{
closesocket(srv_socket);
MessageBox(NULL, " Bind", "Error", MB_OK);
return;
}

6.6.
UDP
.
TCP
.

6.6.1.

listen

- 49 -

int
listen(SOCKET sock, int backlog);

sock ,
, backlog
(
1 5).
(IP-, ).
listen

WSANOTINITIALISED WSAStartup

WSAENETDOWN

WSAEADDRINUSE
WSAEINPROGRESS
Windows
Sockets

WSAEINVAL


WSAEISCONN

WSAEMFILE

WSAENOBUFS
WSAENOTSOCK

WSAEOPNOTSUPP
listen

listen
if (listen(srv_socket, 1) == SOCKET_ERROR)
{
closesocket(srv_socket);
MessageBox(NULL, " Listen", "Error", MB_OK);
return;
}

, .
accept
, ;
.
accept
SOCKET
accept(SOCKET sock, struct sockaddr FAR *addr, int FAR *addrlen);

- 50 -

sock ,
. addr ,
, (
,
addrlen).
accept

WSANOTINITIALISED
WSAENETDOWN
WSAEFAULT
WSAEINTR
WSAEINPROGRESS
WSAEINVAL
WSAEMFILE
WSAENOBUFS
WSAENOTSOCK
WSAEOPNOTSUPP
WSAEWOULDBLOCK

WSAStartup

addrlen

WSACancelBlockingCall
Windows
Sockets
accept
listen



,

,

( ) Windows Sockets, .
, ,
accept, WSAAsyncSelect,
,

#define WSA_ACCEPT (WM_USER+1)
//
// WSA_ACCEPT
rc = WSAAsyncSelect(srv_socket, hWnd,
FD_ACCEPT);
if (rc > 0)
{

WSA_ACCEPT,

- 51 -

closesocket(srv_socket);
MessageBox(NULL, " WSAAsyncSelect",
"Error", MB_OK);
return;
}

srv_socket. FD_ACCEPT, ,
hWnd
WSA_ACCEPT, .
, ,

void
WndProc_OnWSAAccept(HWND hWnd,
UINT msg,
WPARAM wParam,
LPARAM lParam);
{
int rc;
//
//
if (WSAGETSELECTERROR(lParam) != 0)
{
MessageBox(NULL, " Accept", "Error", MB_OK);
WSAAsyncSelect(srv_socket, hWnd, 0, 0);
return;
}
//
acc_sin_len = sizeof(acc_sin);
//
srv_socket = accept(srv_socket, (LPSOCKADDR) & acc_sin,
(int FAR *) & acc_sin_len);
if (srv_socket == INVALID_SOCKET)
{
MessageBox(NULL, " Accept, ",
"Error", MB_OK);
return;
}
//
// ,
// WSA_NETEVENT.
//

- 52 -

rc = WSAAsyncSelect(srv_socket, hWnd, WSA_NETEVENT,


FD_READ | FD_CLOSE);
if (rc > 0)
{
closesocket(srv_socket);
MessageBox(NULL, " WSAAsyncSelect",
"Error", MB_OK);
return;
}
} // WndProc_OnWSAAccept


accept, . WSAAsyncSelect ,
, .
6.6.2.
, CLIENT, [13].

SetConnected
SOCKADDR_IN dest_sin;
void SetConnection(HWND hWnd)
{
PHOSTENT phe;
//
srv_socket = socket(AF_INET, SOCK_STREAM, 0);
if (srv_socket == INVALID_SOCKET)
{
MessageBox(NULL, " ", "Error", MB_OK);
return;
}
// IP-
dest_sin.sin_family = AF_INET;
//
phe = gethostbyname("localhost");

- 53 -

if (phe == NULL)
{
closesocket(srv_socket);
MessageBox(NULL, " GetHostByName",
"Error", MB_OK);
return;
}
//
memcpy((char FAR *) &(dest_sin.sin_addr), phe->h_addr, phe->h_lenght);
//
dest_sin.sin_port = htons(SERV_PORT);
//
if (connect(srv_socket, (PSOCKADDR) &dest_sin, sizeof(dest_sin)) > 0)
{
closesocket(srv_socket);
MessageBox(NULL, " ", "Error", MB_OK);
return;
}
} // SetConnection

socket , dest_sin. IP
gethostbyname, localhost.
HOSTS 127.0.0.1
. . . localhost . . .
127.0.0.1 localhost
. . . localhost . . .

127.0.0.1 , ,
TCP/IP, .
connect
.
6.7.
. TCP send recv, Windows Sockets.

- 54 -

send 4 -
sock, , buf, , bufsize flags
int send(SOCKET sock, const char FAR *buf, int bufsize, int flags);

C-
char szBuf[80];
lstrcpy(szBuf, " ");
send(srv_socket, szBuf, lstrlen(szBuf), 0);

recv send
int
recv(SOCKET sock, char FAR *buf, int bufsize, int flags);

send recv
. recv , , send
recv.

SOCKET_ERROR,
WSAGetLastError.
,
send

WSANOTINITIALISED
WSAENETDOWN
WSAEACCES
WSAEINTR
WSAEINPROGRESS
WSAEFAULT
WSAENETRESET
WSAENOBUFS
WSAENOTCONN

WSAStartup

(broadcast),


WSACancelBlockingCall
Windows
Sockets
buf ( , )


- 55 -

WSAENOTSOCK
WSAESHUTDOWN
WSAEWOULDBLOCK
WSAEMSGSIZE

WSAEINVAL
WSAECONNABORTED
WSAECONNRESET


shutdown
,
SOCK_DGRAM ( ),

Windows Sockets
bind
-

recv

WSANOTINITIALISED
WSAENETDOWN
WSAENOTCONN
WSAEINTR
WSAEINPROGRESS
WSAENOTSOCK
WSAESHUTDOWN
WSAEWOULDBLOCK
WSAEMGSIZE
WSAEINVAL
WSAECONNABORTED
WSAECONNRESET

WSAStartup



WSACancelBlockingCall
Windows
Sockets

shutdown
,
,
bind
-


. ,
Windows Sockets.
SERVER, [13].


WSAAsyncSelect, FD_READ FD_CLOSE.
WSA_NETEVENT , .

- 56 -

#define WSA_NETEVENT (WM_USER+2)


rc = WSAAsyncSelect(srv_socket,
hWnd,
WSA_NETEVENT,
FD_READ | FD_CLOSE);


WSAAsyncSelect FD_WRITE.
WSAAsyncSelect
NULL, - SOCKET_ERROR.
,
WSAGetLastError.

WSANOTINITIALISED
WSAENETDOWN
WSAEINVAL
WSAEINPROGRESS

WSAStartup

bind
Windows
Sockets

, lParam WSAGETSELECTERROR.
FD_CONNECT

WSAEADDRINUSE
WSAEADDRNOTAVAIL
WSAEAFNOSUPPORT
WSAECONNREFUSED
WSAEDESTADDRREQ
WSAEFAULT
WSAEINVAL
WSAEICONN
WSAEMFILE
WSAENETUNREACH
WSAENOBUFS
WSAENOTCONN






namelen






- 57 -

WSAENOTSOCK
WSAETIMEDOUT

FD_CLOSE


WSAENETDOWN
WSAECONNRESET
WSAECONNABORTED

FD_READ, FD_WRITE, FD_OOB


FD_ACCEPT WSAENETDOWN.
WSA_NETEVENT
, ,
WSAAsyncSelect ,
. , ,
( wParam , , lParam - )
void
WndProc_OnWSANetEvent(HWND hWnd,
UINT msg,
WPARAM wParam,
LPARAM lParam)
{
char szTemp[256];
int rc;
// ,
//
if (WSAGETSELECTEVENT(lParam) == FD_READ)
{
rc = recv((SOCKET) wParam, szTemp, 256, 0);
if (rc)
{
szTemp[rc] = '\0';
MessageBox(NULL, szTemp, " ", MB_OK);
}
return;
}
// ,
else
if (WSAGETSELECTEVENT(lParam) == FD_CLOSE)

- 58 -

{
MessageBox(NULL, " ", "Server", MB_OK);
}
} // WndProc_OnWSANetEvent

UDP (User Datagram Protocol), , , ( broadcast).


, . UDP
socket IP bind;
connect, listen accept .
UDP sendto recvfrom ( send recv ).
C- SERVER
CLIENT, , [13]; Pascal- [6], .
Java [16].
Delphi/C++Builder Inprise Corp. , , HTML .
WinSock-
InterNet

info.isoc.org/home.html
www.ietf.cnri.reston.va.us/home.html
ds.internic.net/ds/dspg/intdoc.html
www.internic.net/std
www.sockets.com
www.startup.com .

, Windows Sockets ( ),
( ) .
7. InterNet
C InterNet (INTERconnection NETwork) , ,
( )

- 59 -

.
(
, , . .7.1),
HTTP; FTP ( ), MIME ( ), SMTP
POP ( ); TCP/IP.
InterNet www.ietf.cnri.reston.va.us.
InterNet WEB
() ( ),
.
InterNet, 90- IntraNet. IntraNet ( -
) , TCP/IP,
InterNet HTML- ,
InterNet (,
Microsoft Information Server, WEB-); IntraNet InterNet.

.7.1. .

- 60 -

7.1. InterNet
60- DARPA
(Defence Advanced Research Project Agency).
ARPANET ( , -
).
InterNet
.
( )


FTP
Gopher


( E-Mail)

( News)
WWW
(World Wide Web )


()
( )
(, , ..) ; ,
(,
, - , .)
( ), , , .

(
, ),


, .
Windows9x WindowsNT WorkStation 4.0
Personal Web Server Microsoft Peer
WebServices ( WindowsNT 4.0 Server Microsoft Information Server),
[15]; TCP/IP InterNet (
WEB-; , CGI-

- 61 -

). UNIX Apache ( LINUX, Solaris, SunOS 4.x Windows).


InterNet .
InterNet .
, ( )
WEB-, WEB- (
WEB-) WEB-, ; ,
.

InterNet , , -, .,
;
.
7.1.1. InterNet
InterNet (, host)
32- (
4 - , 198.137.240.91).
, (Network ID),
- (Host ID). , Network ID,
, Host ID. ( Network ID Host ID)
TCP/IP .
(A, B, C, D...), Network ID Host ID.
- 5

A
B
C

()
00000001
01111110
10000000
10111111
11000000
11011111

()

host

16 .

1 126

126

128 191

16382

65534

192 223

2 .

254

- 62 -

D
E

11100000
11110111
11110000
11110111

224 239

240 247

0, 7 , 24 (host) . 2
(0 127) 2 -2=126 ,
24
2 -2 16 . .
, , (, General Electric, Defence
Intelligence Agency, AT&T Bell Laboratory, Massachusetts Institute of
Technology).
10 - B,
16 , - host. , InterNet.
110, 21 , 8 - host-. , 250
InterNet .
D, 110,

( , , , ). InterNet , , .
11110 .

0.0.0.0 , ..
.
127.0.0.1 .
, , ,
(, 191.24.2.0).
(,
193.24.2.255), ,
.

- 63 -


(, 255.255.255.255), .
(, 0.0.0.2).
InterNet
( , , InterNet).
, WWW
( - ).
InterNet InterNIC (Internet Network International Center)
www.internic.net FTP ftp.internic.net
hostmaster@internic.net.

RFC 950 Internet Standart Subnetting Protocol.
32- ,
Network ID
Node ID , Network ID .


A
B
C

,
255.0.0.0
255.255.0.0
255.255.255.0


TCP/IP (, ,
65534 ,
). InterNet
//host- ( / ). , InterNet .
() IntrNet
IP-; IP 6 ( IPv6). IPv6
IP- , -

- 64 -

(
; . ,
3.2).
IP-, 4- ,
. ..
,
(.7.2);
, .
InterNIC, . - RFC 1034
Domain Names - Concepts and Facilities RFC 1035 Domain Names - Implementation and Specification.
IP InterNet
DNS (Domain Name System), ( .. DNS)
IP-. Windows
WINS, ,
TCP/IP NetBIOS Microsoft. IP
HOSTS ( NetBIOS-
LMHOST); .
InterNet
, ( )

gov
mil
com
org
edu
net

- 65 -

.7.2. ()
().

InterNet
, ( ftp.wisc.edu)

au
de
ru
ua
us

su,
.
() InterNet ..
URL (Uniform Resource Locator), :
://__/__/_
, URL-
(
) ,
. URL- ,
,

- 66 -

,
InterNet.
WWW
URL
http://host[:port][path]
host . IP- ( ),
http://www.microsoft.com
http://154.23.12.101
port HTTP, 80. , TCP/IP
,
, . [13]. , URL-

http://www.my_server.srv/:82
( @ ) ( . ).
7.2. InterNet
(. .7.1) InterNet,
,
.
- (
-),
( )
14400 57600 (),
( .7.3 7.4 , ). ..
(.. ).

- 67 -

( ,
), ; DSL (Digital Subscrabe Line)
, 7,5 M/ .

InterNet , proxy- (.7.4). Proxy-
( ) (, , . - .. ).
Windows ,
TCP/IP ( ) ,
( );
, , [13].
InterNet (E-Mail).
, , ; ,
, ( WEB-). , () ,
( ).
E-Mail
E-Mail
vep@oktava.msk.su
e881@yahoo.com
info@daidocomp.com
frolov@glas.apc.org



DaidoSeiko

- 68 -

.7.3. .

E-Mail
. , (, ,
WinWord .). .7.5
Microsoft News and Mail.

.7.4. InterNet .


(To ),
(Subject) ; ()

- 69 -

(
).
,
, , .

Eudora for Microsoft Windows, Microsoft Exchange . [13].
.. (), . , ( ),
.
, . (, Borland Delphi, Interbase, Oracle
.), .
, ; InterNet (
);
( ). News Express, , (
, , ).

- 70 -

.7.5. Microsoft News


and Mail.

Telnet (Terminal Access to a remote host)


( , ,
,
). HyperTerminal ( Hilgraeve Inc.)
.
InterNet
( ) ( Microsoft Chat

, ). ICQ ( I Seek You - ,
Mirabilis, -, 1996, 2000 .)
( , . www.icq.com
www.dir.ru/internet/icq/russian/index.htm).
InterNet
(.. IP-), ,
; .

- 71 -

(streaming) ,
3.4 MPLS, ( ).
InterNet
FTP , , FTP-32 Client
for Windows (.7.6),
(, Norton File Manager Windows
Commander).
FTP- (
) , FTP-32 Client for Windows, , ;
, (
), FTP- ( ).

- 72 -

.7.6. FTP-32 Client for


Windows.

InterNet -
Word Wide Web (WWW),
(browser) (navigator).
WWW
(. ), (
HTTP) (
WEB-), , ,
(, );
WWW .7.7.
WEB-
Mosaic ( NCSA, National Center for Supercomputing
Applications, Illinois University, 1993), Cello (LII, Legal Information Institute,
Cornell Law School), Lynx ., Microsoft Internet Explorer, Netscape Internet Navigator, Opera (Opera
Software, www.opera.com) ;
Netscape Communications Corp. Microsoft Corp.

- 73 -

.7.7. WWW.

.7.8
Netscape Communicator, .7.9 - Microsoft
Internet Explorer ( WWW-
, ).
Netscape Communications Corp. ,
Microsoft Corp.
( ). Microsoft Corp.
HTML (DHTML,
) WEB, (scriplets, c ).

WEB-, TCP/IP, HTTP, FTP,
E-Mail FTP-, () , Microsoft Internet Explorer ( WWW-)
WEB-, Netscape
Communications Corp.
HTML-. home.netscape.com www.microsoft.com/ie . Mozilla ( Mozaic, . mozilla.ru) BackOffice (backoffice.ru).
TCP/IP
PING ( InterNet-), PM Ping (
OS/2 Warp), NETSTAT ( ), ROUTE ( -

- 74 -

), FTP ( ), FTP-PM ( OS/2 Warp),


. [13].
InterNet (

, ). ()
1995 . VRML (Virtual Reality Modeling Language) -
; VRML97,
VRML 2.0; 2002 . VRML, X3D [22]. VRML
() WEB; VRML ,
, , Java- ( VRML .
InterNet-
www.webmaster.com/vrml,
webspace.sgi.com,
vrml.wired.com). InterNet- VRML
Worlds Chat ( Worlds, Inc.,
www.worlds.net), Prosperos Global Chat (www.prospero.com), Internet Round
Table Societys WebChat (www.irsociety.com) .
VRML-
() WEB- - Live3D
CosmoPlayer ( Cosmo Software, www.cosmosoftware.com) Nestcape Communicator, WorldView 2.0 (platunim.com) MS Internet
Explorer 5.0; VRML- Cortona ( ParallelGraphics, www.paragraph.ru).
VRML
( . www.srcc.msu.su/vrml), ( ) VRML- NotePad WordPad; VRML- , , VRMLPad ParallelGraphics ( www.paragraph.ru). (, 3D Studio Max) VRML.

- 75 -

.7.8. Netscape Communicator


4.5.

7.2.1. HTML

, WWW- WEB- ( HTML-),
, ( )
HTML- .
HTML (Hyper Text Markup Language) - (
, ). HTML
(VGA, SVGA .) ,
. HTML SGML (Standard Generalized Markup Language). HTML XML
(eXtended Markup Language); XML- WEB ICE (Information and Content Exchange).
HTML
- -

- 76 -

. HTML ( ) HTML
WEB- ( Windows UNIX, Solaris,
Mac OS .).
HTML - , ( , , , . ). HTML (.. WEB-) Netscape Composer, Microsoft FrontPage, Internet Assistant for Microsoft Office,
Microsoft Word Internet Assistant, Microsoft Excel Internet Assistant, Microsoft
PowerPoint 95 Internet Assistant . WYSIWYG (What You See Is What Your Get - ,
) / WEB- .

.7.9. Microsoft Internet Explorer 4.0.

3.0 3.2 HTML, .

- 77 -

HTML- :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>My first WEB-page</TITLE>
</HEAD>
<BODY>
WEB- !
</BODY>
</HTML>

, HTML-
<HTML> </HTML> <BODY>...</BODY> ( ),
.
FIRST.HTM (
HTML), Microsoft Internet
Explorer |
HTML- .7.10 .

.7.10. HTML-.

HTML (/
), HTML .

- 78 -


( <A...> </A>
, ( )
ABOUT_ME.HTM ( <A>):
<a href="about_me.htm"></a>
WEB- !

- () MY_BORN
ABOUT_ME.HTM
<a href="about_me.htm#my_born"></a>
WEB- !

HTML , ,
,
, .
URL- HTML-
<img src="http://pilger.mgapi.edu/gif_89/crim_ani.gif">

CRIM_ANI.GIF,
GIF_89 WEB- pilger.mgapi.edu (,
); , ( WEB-).
WEB- ( )
<a href="http://pilger.mgapi.edu "> WEB-</a>
<a href="mailto:vep@oktava.msk.su"> E-Mail</a>

InterNet, ( ) .
- HTML, ;
HTML [6,13,15,19].

- 79 -

Microsoft Corp.
include (
- STM).
HTML (, ,
- HTML
) - , HTML
. HTML ( / )

Java - - ( .
7.2.2).
JavaScript, VBScript PerlScript - , HTML- (. 7.2.3).
CGI ISAPI - HTML, (. 7.2.4).
ActiveX - Microsoft Corp. , WEB- ( ) ; Win32 OLE
API ( -
www.microsoft.com). ActiveX, ,
Inprise Corp. ( MIDAS
, ) InterNet [7].
IDC - Internet Database Connector -
ODBC (Open Database Connectivity) /
Microsoft SQL Server (IDC ).
ASP (Active Server Pages) - ,
CGI ISAPI,
WEB- [23]. ASP
, JScript VBScript,
SQL COM-.
PHP/FI -
WEB-,
SQL; PHP/FI ( - 2.0)
HTML-
(. 7.2.4).

InterNet ( [19] .)

- 80 -

RealAudio ( Progressive Network) - (streaming audio), () ( www.realaudio.com); - SOX (SOund eXchange, . www.spies.com/Sox/). - IWave ( InternetWave, VocalTec,
www.dspg.com) TrueSpeech.
MBONE - Multicast Backbone - , InterNet (multicasting).
1 / ( 128
/), 32
64 / (MBONE , , ).
MBONE NetVideo, VisualAudioTool
Whiteboard ( UNIX).
StreamWorks - Xing Technology Corp.
(
www.xingtech.com). NBS Reuters StreamWorks , WEB- StremWorks ( 14,4 / 44,1 /
112 / ).
VRML - Virtual Reality Modeling Language - , . [22].
90- ( WAP - Wireless
Application Protocol) (
1999 Microsoft Corp. WAP
Mobile Explorer). InterNet-
( )
(,
wap.infoart.ru Infoart Stars,
. Motorola (
Java ,
HTML- ) . WAP
www.iname.ru .

www.primorye.ru/noc/ping.asp, ( ping );

- 81 -

VisualRoute
(www.visualware.com/download/index.html).
7.2.2. Java InterNet
( ) - , (
) 1995 Sun Microsystems Java ( Oak).
Java C++,

( ).
( , ).
, C++.
() Java- - ( , JVM - Java Virtual Machine),
- ( ) (. .7.11). Java Solaris, Windows9x,
WindowsNT, OS/2 Apple Macintosh, Netscape Microsoft.

Windows

Apple Macintosh

- 82 -

(
EXE-)


(
EXE-)
a)

Windows

Apple Macintosh

Java

Java
( -
Apple Macintosh)

Sun

( -)

Java
( -
SUN)
)

.7.11. , () Java ().

Java ,
InterNet. Java
1. (network awareness) - ,
,
Java- ( InterNet - low-level socket interface).
2. - Java-
.
3. - , Java ( , , )
SecurityManager.

- 83 -

4. -
.
Java-
( , , - ;
),
HTML- MY_APPLET ( 200 100 YourBorn 1967)
...
<title> HTML</title>
<body>
<applet code="my_applet.class" width=200 height=100>
<param name=YourBorn value="1967">
</applet>
</body>
...

Java
,
( ) - Java-,
( , , ) ( -). Java

InterNet.
Java- Java Developers Kit
java.sun.com/JDK-1.0.
Java
Microsoft Visual J++, Symantec Cafe, JavaWorkShop (Sun Microsystems) Inprise Corp. 1999 Sun
Microsystems () Java2, Java (.
www.gartner.com/webletter/sunus/default.html).
Java
[16,19,21] WEB- Sun Microsystems
java.sun.com, ( Java-)
spectr.orc.ru.
Java - , General
Magic Telescript, , -

- 84 -

,
( Java- ).
Microsoft Corp. SUN Java
( ) dotNet (.Net)
(, , Net Framework,
Office.Net, C#

Visual Studio.Net

.,
.
msdn.microsoft.com/net,
www.microsoft.com/net,
msdn.microsoft.com/vstudio/nextgen), , Java
, . .Net ,
WEB- .
- Java (, , ActiveX), (..
),
( ) .
7.2.3. JavaScript, VBScript PerlScript
Java ; Java,
(, ,
HTML).
( Netscape Communication Corp.,
LiveScript) JavaScript (
Java), JavaScript
WEB- . Microsoft Corp. Microsoft Internet Explorer JScript ( JavaScript), Microsoft Basic
VBScript ( JavaScript). Java, JavaScript
VBScript ( ) WEB-,
WEB ( ).
HTML- JavaScript
<HTML>
<HEAD>
<TITLE> WEB-</TITLE>
</HEAD>

- 85 -

<BODY>
<H1>JavaScript test</H1>
<SCRIPT LANGUAGE="JavaScript">
document.write(" " +
" JavaScript");
</SCRIPT>
</BODY>
</HTML>

JavaScript <SCRIPT
LANGUAGE=JavaScript> </SCRIPT> write
document, ( ) HTML , (, , ).
JavaScript ( ,
,
.), WEB- .
, HTML-
JavaScript- MakeOnLoad , MakeOnUnload - (, ).
...
<BODY onLoad="MakeOnLoad()" onUnload="MakeOnUnload()">
...


- Ok Cancel ( - )
( OMD.RAR )
...
<A HREF="JavaScript:
if (confirm(' ' +
' OMD.RAR 330 kb ?'))
location.href = './bin/omd.rar';">
</A> OMD ?
...

JavaScript , ,
, ,
WEB-, , ( -

- 86 -

), Java .,
- . JavaScript- Microsoft Script Debugger.
VBScript JavaScript ,
Basic-
Microsoft Internet Explorer.

JavaScript [18,19], () JavaScript ( HTML-)
pilger.mgapi.edu. JavaScript-

www.cris.com/raydaly/hjdemo.shtml
www.homepages.com/fun/I040EZ.html
www.geocities.com/SiliconValley/7116/jv_cale.html
www.best.com/nessus/jstodasy.html

Java, JavaScript VBScript



.
WEB- (, Microsoft Internet Explorer
4) HTML- PerlScript. CGI-
PerlScript WEB- ( HTML-
PerlScript-), . [20].
<!DOCTYPE HTML PUBLIC -//W#C//DTD HTML 3.2//EN>
<HTML>
<HEAD>
<TITLE>My first PerlScript example</TITLE>
</HEAD>
<BODY>
<H2>PerlScript example</H2>
<SCRIPT LANGUAGE="PerlScript">
$window->document->write("Hello, PERL !");
</SCRIPT>
</BODY>
</HTML>

7.2.4. CGI ISAPI


CGI (Common Gateway Interface -
) ISAPI (Internet Server API, NSAPI - Netscape

- 87 -

Server API)
WEB-;
HTTP , (, )
HTML- HTML-.

HTML
, ( , , .,
;
,
).
(, ) CGI ISAPI.
CGI/ISAPI-
( ) HTML ()
( ).
HTML- ( text1 text2)
...

<FORM METHOD=GET ACTION=http://www.my_server.ru/cgi/form.exe>
<TABLE border=0>
<TR>
<TD> :</TD>
<TD><INPUT TYPE=text NAME="text1" VALUE=" 1" size=33>
</TD></TR>
<TR>
<TD> :&nbsp;</TD>
<TD><INPUT TYPE=text NAME="text2" VALUE=" 2" size=33>
</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD><INPUT TYPE=submit VALUE=" ">
</TD></TR>
</TABLE>
</FORM>
...

- 88 -

.7.12 ( ).
ACTION , (
CGI, ).
METHOD WWW
- GET ACTION CGI
QUERY_STRING, METHOD=POST CGI
stdin.
, ( ) (, Pascal)
WinCGI, Windows [6].
query-string
URL (
CGI- )
http://www.my_server.ru/cgi/search.exe?query-string

METHOD=GET
QUERY_STRING :
1=1&2=2&3=3

NAME , . CGI
c QUERY_STRING , .
C- getenv
char * szQueryString;
szQueryString = getenv("QUERY_STRING");

- 89 -

.7.12. .

QUERY_STRING .. URL (
+ ,
%xx, -
ASCII-); CGI- .
METHOD=POST CGI
stdin (
- fread scanf) GET , stdin CGI-
CONTENT_LENGTH
int Size;
Size = atoi(getenv("CONTENT_LENGTH")); //
char szBuf[8196];
fread(szBuf, Size, 1, stdin); //

- 90 -

GET
(
QUERY_STRING ), POST .
(GET
POST) CGI stdout ( WWW-
). CGI- HTML
stdout
...
printf("Content-type: text/html\n\n"); // HTML
printf("<!DOCTYPE HTML PUBLIC \""-//W3C//DTD HTML 3.2//EN\"">");
printf("<HTML><HEAD>
<TITLE>My first dinamic HTML-page</TITLE>
</HEAD><BODY>");
printf("<H1> :</H1>");
...
...
printf("</BODY></HTML>");

HTML-
. HTML-
( )
HTML-
stdout.
CGI- () (
) , .
, CGI- , ,
;
CGI- Perl (Practical Extraction and Report Language, Pathologically Eclectic Rubbish
Lister,
.
InterNet-
www.perl.com,
www.cpan.org,
orwant.www.media.mit.edu/the_perl_journal, www.tpj.com) [20], (
C/C++). , [16] CGI Java, [20] - Perl; WEB- pilger.mgapi.edu Perl.
CGI ,
WWW- CGI- ( ), ..
, - (, )
( -

- 91 -

). ISAPI, ( DLL-) ( - .. ISAPI- , WEB-, ISAPI-


). CGI, ISAPI- ,
ISAPI;
[15].
(, Apache) Perl,
CGI-
( ); CGI . WindowsNT (.
www.activeware.com) PerlScript ( ActiveX)
PerlIS ( ISAPI- [20].
ISAPI ( CGI ), ISAPI (
, , ,
, .).
ISAPI DLL-
ACTION ( CGI), METHOD,

GetServerVariable ( ) ReadClient ( ), ( CGI, HTML-) WriteClient ServerSupportFunction.

CGI ISAPI [6,15,19].
, CGI- ISAPI- WEB-. , [20]
CGI- Perl;
WEB-,

www.w3.org/Security/Faq/www-security-faq.html
www.perl/com/CPAN-local/doc/FAQs/cgi/perl-cgi-faq.html
stars.com/Authoring/Scripting/Sequrity
www.go2net.com/people/paulp/cgi-sequrity/safe-cgi.txt

CGI PHP/FI

- 92 -

( / ),
HTML- ,
( Apache). PHP/FI SQL-,
( C). PHP/FI (CGI- , PHP/FI-
),
.
, PHP/FI, (
).
7.3. InterNet
-

( 2000 9
- 2 10 ,
6
7 10 ).
( , , )
.
.
. (directories) (search engines).
, .
, .., . , - .
, .. . ,
, . ,
,
( ).
- .
. ,
, .. , -

- 93 -

,
. , ,
, ,
.
(rawlers, spiders
.) - , ,
,
( WEB- ROBOTS.TXT). WEB- ( ),
.
, -, . , .
AltaVista ( DEC, .7.13), ndex (CompTek International), RAMBLER
(Stack Ltd., InterNet, .7.14),
YAHOO, Lycos .
600 (. www.beaucoup.com/engines.html),

pilger.mgapi.edu/right_7.htm#lab_4).
.
<meta
name=keywords content=...> ( WEB-)
. RAMBLER, ,
HTML-
, RAMBLER , ( , ) .
, InterNet .
-
,
, . () - ,
, Like this.
, , . - -

- 94 -

, , , , .

.7.13. AltaVista.

,
.

( * .),
OR, AND, NOT ., ,
(
)
(( OR ) AND

(, ndex)
, ,
, ,
, .

- 95 -

.7.14. RAMBLER.

. ,
,
. , NEAR ,
,
. FOLLOWED BY , , ADJ ( ) .

( , .. ),
(, )

- 96 -

(( OR ) AND AND


, , (
- ).
7.4. InterNet
Microsoft Visual C++ MFC (Microsoft Foundation Classes) InterNet INTRANET
Windows.
Win32 Internet ( WinInet,

WININET.DLL,
www.microsoft.com/win32dev) HTTP, FTP GOPHER ( ).
, WEB-. , Microsoft Internet Explorer DLL-, ActiveX; Microsoft Corp. ( Microsoft Web Browser Control Visual C++ DLL-, ActiveX). Visual C++ InterNet ( API Windows ShellExecute

dials.ccas.ru/frolov/rwin/webhelp.html [17],
C++ ).
() InterNet -
Windows (DDE, Dinamic Data
Exchange) (OLE, Object Linking and
Embedding). , () ,
. Netscape Communications Corp. ,
API-.
DDE , , URL Netscape -

- 97 -

; DDE- .
OLE ( ).
Pascal [6].
1999 . Netscape Communications Corp. ( ).
InterNet
. , SETI@home,

(
,

3
90 10 ). ,
SETI@home - 9
175 10 ( 25

i586);


SETI@home

WEB-
setiathome.ssl.berkeley.edu/about_seti/about_seti_at_home_1.html ( setiathome.spb.ru).
(www.technosphere.org.uk), . ( ) InterNet.
8.
8.1.
,
, , ;
InterNet;
.

- 98 -

-
(,
).
- ,
.
- (, , ).

( , ), (, ).
-
(firewall) - ; , /
( - proxy, InterNet ).
, ISAPI, [15].
[6]. , , .
, - ( ) .
, .
(keys). ( ) , . , 840
256 , 40- 2 =
1099511627776 , 128- ( ,
22
4,2 10 256 . , -

- 99 -

; 2000 . 24
3,5 10 US$).
( ) , (..
,
).
- .
- , .
- , . , , .

(DES, Data Encryption Standart), , DES 64 56- .
. ,
, . , . - .
,
.
RSA - , 1983 Public
Key Partners (PCP); RSA
. RSA de-facto
, DES. - DES ( ),
RSA , , .
- ,
.
, (message digest),
, . ,

- 100 -

, . , .
. ,
( ).
,
;

.
( ).
.
.

CA (Certifying Authority), , VerySign, ; (Distinguished Name) ,


WEB-
( ).
RSA P
Q, P Q N - ( P Q); RSA,
(strong) . - ,
, N
( - - ). , , ( ) .
(one-way function), , - .
- ,
. , 512-
( P Q
6
256 ) , 8,2 10 $US.
E, , N
(P-1)(Q-1), D.
(N,E), - D (
P Q).

- 101 -

P Q, . P Q
( , ,


FedWire II).
RSA
WEB- www.rsasecurity.com.
RSA, Ron Rivest, , RC4. -
RC4 64 ,
.

28147-89 256 , .
8.2.
, .
() SSL, PC STT .
(SSL, Secure Socket Layer)
InterNet , Netscape Communications Corp. - Netscape Navigator Netscape Commerce Server. SSL
, RSA InterNet
. SSL ; SSL, SSL
( TCP). Windows Socket ver.2.0 SSL.
(PCT, Private Communication Technology) Microsoft -; SSL
. PCT
, (HTTP FTP)
.
(STT, Secure Transaction
Technology) Visa Microsoft -

- 102 -


InterNet. InterNet STT

.
.
.
Master Card, IBM
(SEPP, Secure Electronic Protocol), Master Card
Visa International
InterNet - (SET, Secure Electronic Transaction).
8.3.

,
( , )
, .
, ( ),
, (,
, .). D ( )
( );
.
, WindowsNT C2 (
, , ); [5].

- 103 -

, .
( InterNet).
,
, .
,
, InterNet INTRANET,
.

1. . . . . -.: , 1996. -395 c.
2. WindowsNT. . -.: BHV--,
1996. -496 c.
3. ., . NetWare ( Novell). -.: , 1995. -596 c.
4. . . -.: , 1996.
5. . WindowsNT NTFS. . . -.:
Channel Trading Ltd., 1996. -440 c.
6. . . InterNet- DELPHI 2. -.:
DiaSoft, 1997. -640 c.
7. .. Borland C++Builder ( /, , InterNet-). -M.: -, 1998. -240 c.
8. .. . -.: ,
1989. -272 c.
9. . . . . -.: ,
1979. -600 c.
10. .., ..
( , ). , .7. M.: -, 1994. -169 c.
11. .., ..
( IPX, SPX, NetBIOS).
, .8. -.: -, 1995. -160 c.
12. .., ..
( Novell NetWare). ,
.9. -.: -, 1993. -168 c.
13. .., ... (
InterNet, E-Mail, FTP, WWW HTML,

- 104 -

Windows Socket). , .23. -.: , 1996. -288 c.


14. .., .. Windows NT. , .26/27. -.: -, 1996/1997. 272/271 c.
15. .., .. WEB ( HTML, CGI ISAPI, WEB Windows).
, .29. -.: -, 1998. -288 c.
16. .., .. Microsoft Visual J++ (
Java, 1 2). c ,
. 30/32. -.: -, 1997. -288/288 c.
17. .., .. InterNet (Microsoft
Visual C++ MFC, Windows95 WindowsNT). , .31. -.: -, 1997. -286 c.
18. .., .. JavaScript ( JavaScript
WEB). , .34. -.: , 1998. -284 c.
19. . HTML ( , ,
ActiveX, Java). . . -.: , 1997. -256 c.
20. . PERL: . . . -.: ,
2000. -496 c.
21. . JAVA-. . . -.: DiaSoft, 1996. -384
c.
22. .. VRML ( ). -.: , 2000. -288 c.
23. .., .. . .: -, 2001. -560 c.
24. .., .. . - .: , 2002. -608 c.