Systems Communicate 'with Other Systems

Một phần của tài liệu Computer systems a programmers perspective randal e bryant, david r ohallaron (Trang 54 - 57)

Up to this point in our tour of systems, we have treated a system as an isolated collection of hardware and software. In practice, modern systems are often linked to other systems by networks. From the point of view of an individual system, the

I

,;;;;;;=

20 Chapter 1 A Tour of Computer Systems

t .. . •"" ,ãã ,ff, ' ,j} '.fp; ;.< '"l;~~,;j.~.p:.}-;ft,J.L, "~%Â.\}.~ .J~Y~ . ., 4,'i> < "'4'""lJj!'"f"~~. :Z.,""W!.> ~ "4 t. ~ã\i;f

' 4side' The t:inux,prpJã~ct., .,: • ' w, , • ã .. ã •ã <,. ã . 4• , .. "

~ !// Ơ~ ~~ 'ã"' .. ãã- _ãã "';.}"~ -" '~'" -#t_o/ '' -Jt'ft:~. ~. ' ~ ii ~.

;, !u..An_gust 1991; ~ Fmnlsh1rKaualy stul:lelii ri'a'!ile(! u1ust,r'cl'i'NaI\J§,ril~&sdy~'lii1ltlrcecfa if e\\>U' riix-like

~ -'"onerating syStem Kernel:i ~,-.,; _ ããi11 ~y.,, ""?-"' ,,., ' :Jc.,,r ,;, :r ;,-il if fy

1 '<'J "'}_

~ !,; .,, 10,11 {1' 9/0 '<1, ''\, ~~ ; ã~

l:'rom : ... ,,tOrv. ~ aids@t1~a.va .. Hel~iiJ1.'". F1;=-<t:.(nJ~~"i'exieditt f,,Th"~.Ji3.1:J\.')Ơ .. ~.~ãã. ;, -~ãq.,. 'ff'1

-5ti '"'ã!:M4." ~-l .• ,..' ' " "-., .,, • " ~~ . "~., ~ . .J: " .• "; ~ .Jl'

Newsgr:ollpS: comp:dS'".niirlix"' .. _ ~ .~t,,. -~ ,. - :'f • .-,,. ~ ~~-i"'" ã •• 4 ~ã 1 ""'

Subje~t: "'\.f~a'b wo~l~~ _YcfJ"'~ilit~~o-, s~; qloã~-~rl': mi~ix? "'~ 9 }Jl '"'-~ ): ~ I&

.s1119ma.,,r9": s~al'i pp~l .. ~or~,,.nry:;'~,e~.Đg.p~r~t'in&ãã~xst~i ~,~ "71, 1$ -~ • ., ãi-.

Date:" 25.. Au,;g 91 ~~Oãt.,57; :ros:"Gf1J } ,. ''") ã0• • . ,.. ~'" "/! efo :k ~ ~i"~!, Jã1.~ ã~

,1 ~~Jã,*"~ ';}.;~J --~ '."] .. . 14"t:t- "° . ~ãIf~ ã~fl- Êl r \

Hello ~verjbod~,,.q~~i;:ãftã~herp'.: Usi~&;_ãƠ}i~ip --_,1• "4.~ . _,, % "~r J~., ~ J v.&.fttã~ ~'i""~i , I 1 m doing a, (fr~){ qp~r;,a~in~g ~~Y~~em~ ,.(jdst_ ~a ~._h9bq~_•,;.~R1t.,' ~~ pe ~b}"g :t"~~ã l!

~~ ~r~of~s'Sional fik.~ ~u~i*"fp}i'lr:S8§,(~8.P) £AT:;k-foR~s.~~. T~~s,; '11a~:-~beJ~_Ii 12!~~ii;g"i' ~"' .. si~ce' April, <lll:d. is ~tartin~ t~oã~~ãã@:et read~ .. ff!•1d 0likeJ""anl fe~dba9k~~o~

~)11:,ngs- ~G~o'Ele"""~ii~e/~di~l~k~ 'Iit~mi.nix. ft.~ ã19y,. D~~~r,f's~e~bllS :~:;t li'9mewh_<\Z (same physical 1"'.' ,, ~~ , ::." -~ ~. duÊ, ::rããã""ã •• ãã.of t.ll• ,~ '% :ii1e''ã~v:.:stem.'~dll.ll. .,i) t.'$ã1'ã.;;, ~ ~ ~" "4 , 'to .:prac'ti'cal "ã~ ., .• , ., rt. asons'ã'<. ;\' ~. ãã~"i.,

among other thl~&.s)"ãJ. ã &;_,, ~, ã~:i#~. "4ã 1.. y,, ,, ã~ã~. ãã~ ã~~

• 1.1/,,,~'ffe. .," ' ' " if'' ' ~ :J ~

'I':• curr•'l;'J.Y, f'Rr.ted '.bas1hCi-,08),$~d ,!it~ Ct(ig)ã, .~\i!thirlgs; ~ee? ;'t:p,.llof:K(,'• ,

• '

1 1

l •

I

This i_m~l~?sã' ~~~~ ,.~;J.1~.~~tããã~~e;;li~n~g~~n:a.5~1~'!f: ,,w~ith.;ip-~ a . .,. ~_ew :mqnths'.,, and ã•}

I! a ~rke to kilbw'-wnat,fbatJi'M• most" 'j:f~9p'le, .\roulfi'.~ant. ,4nyo.suggestions 'il• ,

aie welscq,m~;, 17ut':'t,.ã~~b,a_.1K:J>rOJE!S~f'l;!:tT~i,,iJl~J-~ffiefj.'"t ~ta~qf~~.;.;,~)'t ;tã '1 .1

~ 'efi~ .~1ã ;t ~)fã~f::4"' ~~- ~...Jt, '~1'l!t, -tw-~. w,. "] • '0"'' ' i f ' ã~;" ~ t.lnus ãã( torvaltj.fo@IsruUn.a~.,h'81Si~i ;"f_i~~ 1kJ,t{; "t ~ã('' w;; ~ x~ .. ;~. ~ 1.-ã ~ , if j

$.s 1:6rvalds. iri1$Jt4te~~liis'~t~tiP)' ;o~~!~cJ~~~~~;~~~\\r& ]Virn~7~art ?fief~t~~ 1sys~t~m~devef-

oped by Andrew ,S:'I'anenll~\lm'f()r ,i:'~l~19atlqi:aJ.i;urpos,~s [i;)'.3} "

The rest: as tl;ley s~y, i,~ ~flito11'. Linux Ms ~yoly~,a.jnfo1~ technical ,and cultural P,henomenonã, BJ ,,

C;_ombihing fofc'es ,WtJi the QNl;FP,rojeqt, ,the Linjlltppof e~~,has,\l~VS~'IPed:a complete, Ppsix-cbmpllant version of the Unix operating, system, incluc;!ing th<fkemel'and all•of the supeortiogãinfrastructure, Linux is avail~bie prr,a:;.ide,irliy oisofuii~!erS.,v~iph;~ill\~1{deyi~es tcl-mainfriin,le,Go.~p11t~rs. A l

group atJBM bas even po't\ell Lih!\?.<:t'o~ii w~iSiiVafcb'1 " "' ' • --< ;

~~ ~ ~-:~~ .. -l~.:,,0~.;;,:~ãJ;i,,,_"li:;n~.:?.Aã'' ã~ ~~~~-':!v= ..

network can be viewed as just another I/O device, as shown in Figure 1.14. When the system copies a sequence of bytes from main memory to the network adapter, the data flow across the, network to another machine, instead of, say, to a local disk drive, Similarly, the system can read data sent from other machines and copy these data to its main memory.

With the advent of global networks such as the Internet, copying information from one machine to another has become one of the most important uses of computer systems. For example, applications such as email, instant messaging, the World Wide Web, FrP, and telnet are all based on the ability to copy information over a network.

- - -

---~

Section 1.8 Systems Communicate, with Other Systems Using NetM:orks 21 Figure 1.14

A network is another 1/0 device.

CPU chip

Bus interiace

SystelJl bus 1/0

bridge f ' ; r - - - v Main memory

{ Expansion slots

'

1/0 bus

r, .,..

,,

1.User types "

''hello" at the keyboard

5. Client prints Mhello, world\n"

string on display

... , lj'

Local telnet client

Mouse Keyboard, Monitor fl

2. Client sends ''hello"

string to telnet se1Ver

_____________ , _____ _

~---'

4. Telnet server sends Mhello, world\n" string

to client

Remote telnet server

Figure 1.15 Using telnet to run hello remotely over a network.

,.

4

§ .. , """""""""' ...

3. Server sends "hello"

string to the shell, which runs the hell,o program and pB.sSes the output

to the telnet Server

Returning to our hello example, we could use the familiar telnet application to run hello on a remote machine.ãSuppose we use a telnet client running on our local machine,\o connect to ii telnet ser;v,rr on a remqf,'r machi\le, After we log in

10 the remote piachine and run a shell, the ~~mote shell is ,waiting to ~eceive an input cpmmand. From this point, running, the hello pr9i;r~m1e11Joteli; 'involves the five basic steps sJiown in Figure 1.15. ,

After we type in, th~ hel:j.o stri,ng to the telnet client and' hit the enter key, the c~ent sends the string to tl:)e tflnet serypr. :~,ft~r,the,ieln~t server receives th~

string from the network, it passes it along to the. remote shell p,rogram.Nej<t, th~

remote shell runs the hello program and passes the output line back to the telnet server. Finally, the telnet server forwards the output string acros~ the network to the telnet client, which prints the output string on our local terminal.

This type elf exchange between clients and servers is. typical of all network applications. In Chapter 11 you will learn how .to' build network applications and apply this knowledge to build a simple Web server.

"

-~--- --~ ~ -~---ã-

--,,.,_ __ _ ---

22 Chapter 1 A Tour of Compufer'Systems

Một phần của tài liệu Computer systems a programmers perspective randal e bryant, david r ohallaron (Trang 54 - 57)

Tải bản đầy đủ (PDF)

(1.120 trang)