Tải bản đầy đủ - 0 (trang)
Chapter 8. Shipping Goods over a (Network) Roadway

Chapter 8. Shipping Goods over a (Network) Roadway

Tải bản đầy đủ - 0trang

datageneratedbytypicalnetwork-basedapplications.

Eachapplicationhasdifferentrequirementsforwhatitneedsto

shipoverthenetwork;that'soneofthethingsthatmakeseach

applicationdifferent.However,manyapplicationshavesome

similarneedsintermsofwhattheysend.Forinstance,many

applicationsnotonlywanttoshipthedataoverthenetwork,

buttheyalsowanttomakesureitgetsthere.Theyrequirea

setofcommontransportationtoolstoprovideimportant

functions,suchaserrorrecovery.Thosecommontoolsare

coveredintheotherchapterinthissection,Chapter9,

"ChoosingShippingOptionsWhenTransportingGoodsoverthe

(Network)Roadway."

Butfirst,youneedtoreadabouttheapplicationscoveredin

thischapter.Thischapterfocusesonthreeapplications:e-mail,

filetransfer,andWorldWideWeb.







NeitherRain,NorSleet,NorDarkofNight:E-Mail

TheUnitedStatesPostalService(USPS)promisesto

consistentlydelivermail,nomatterwhat'sgoingonwiththe

weather.Althoughe-mailservicesmakenosuchpromise,they

havebecomeequallyasimportant.Infact,Iknowalotof

peoplewhogetnervouswhentheycan'tgettotheire-mailfor

justafewminutes!

E-mailworksalotlikepapermailwiththepostalservice

(otherwiseknownassnailmail).Youcanwritealetteron

paperandputitinanenvelope.Ifyouputacorrectnameand

addressonthefrontoftheenvelopeandputitinamailbox,

youcanreasonablyexpectthepostalservicetodeliverthemail

totherightplace.Ifyouputareturnaddressontheenvelope,

therecipientcanreplybyputtingyouraddressonthefrontof

theenvelope.

Forthoseofyouwhomightnothaveusede-mailbefore,it

allowsyoutodobasicallythesamething,butwithoutthe

paper.E-mailallowsyoutotypesometext,identifytowhom

youwanttosendthetextbyputtingthatperson'se-mail

addressatthetopofthee-mail,andsendthee-mail.By

sendingthee-mail,youdotheequivalentofgivingthee-mail

tothepostalservice.Theservicedeliversthee-mail,andthe

nexttimeyourfriendcheckshise-mail,hereceivesthe

messagethatyousent.

Eache-mailincludesthetextyoutyped,therecipient'se-mail

address,andyoure-mailaddress.Becausetherecipientnow

knowsyoure-mailaddress,hecaneasilyrespondtoyouremail.E-mailalsoenablesyoutosendamessagetomultiple

recipientsatonce.



DroppingOffandGettingYour(e)Mail



Ifyouliveinahouseorapartment,apostalworkertypically

comesbyyourplaceeveryworkingday.Heleavesyourmailin

yourmailbox.Healsopicksupanyoutgoingmailthatyouleft

eitherinyourmailboxorinacentralizedpostofficebox(PO

box)thatwassetupjustforoutgoingmail.Figure8-1shows

thegeneralidea.



Figure8-1.PostalWorkerPickingUpand

DroppingOfftheMail



[Viewfullsizeimage]



Afterthepostalworkerhaspickedupyourmail,hebringsit

backtothelocalpostoffice.Eventually,yourlettergetstothe

postofficenearyourfriendtowhomyouaresendingtheletter.

Atthatpoint,thelocalpostalworkeratthedestinationputsthe

letterinthePOboxatyourfriend'splace,wherehecanpickup

theletterwhenhegetshome.

Simpleandunsurprising,right?Well,e-mailworkssimilarly.If

youweretocreateandsendane-mailtoyourfriend,yourPC

wouldnotactuallysendthee-mailtoyourfriend'sPC.Instead,

youwouldsendthemessagetoyoure-mailserver,whichisthe

equivalentofdroppingoffaletteratthelocalpostoffice.Your

e-mailserverwouldsendthee-mailtoyourfriend'se-mail

server,whichistheequivalentofthepostalservicedeliveringa

paperlettertothepostofficenearyourfriend.Then,atsome



pointinthefuture,yourfriendwouldcheckhere-mailand

retrievethee-mailfromherlocale-mailserver,whichisthe

equivalentofretrievingherpapermailfromherPObox.Figure

8-2showsthesamebasicflowassnailmail,butinsteadnow

fore-mail,withKeithsendingane-mailtothesalesdepartment

atfredsco.com(sales@fredsco.com).



Figure8-2.SendingE-MailUsingE-MailServers



[Viewfullsizeimage]



Althoughnotexactlylikethepostalservice,thesamegeneral

ideasapply.Eachcompanyhasone(ormore)e-mailservers,

actingaslocalpostoffices.Also,Internetserviceproviders

(ISPs)haveone(ormore)e-mailservers.Ifyouusee-mail

fromyourcorporation'senterprisenetwork,youtypicallyuse

yourcompany'se-mailserverstodropoffandpickupe-mail.If

youconnecttoanISPfromhome,youwouldusethatISP'semailserverstodropoffandpickupe-mail.



PostalAddressVersusE-MailAddress

Tosendsnailmail,youneedtoputtherecipient'snameand

addressonthefrontoftheletter.Thepostalservicethen

deliversthelettertothecorrectaddress.Similarly,tosendan

e-mail,youneedtoputtherecipient'se-mailaddressonthee-



mail.Ane-mailaddressidentifiestheindividualuserwho

shouldreceivethee-mail,allowingthee-mailserverstodeliver

themailtotherightperson.

E-mailaddresseshavetwoparts:thenameofthee-mailuser

andthenameofthee-mailserver.Thenameoftheusersits

beforethe@sign,andthenameoftheserversitsafterthe@

sign.Forexample:

tweedledee@fredsco.com

Figure8-3showswhyatwo-parte-mailaddressisuseful.Both

KeithandConnersendane-mailtodifferentpeopleinside

Fredsco.Thetextfollowingthefigureexplainshowthee-mail

addresshelpsindeliveringthee-mail.



Figure8-3.HowaTwo-PartE-MailAddressIs

Used



Notethatthee-mailsoftwareonKeith'sandConner'sPCsdo

notthinkabouttheaddressatall.ThePCsalwayssendtheiremailstotheirrespectivelocale-mailserver.Inreallife,when

yousendapaperletter,youprobablygivethelettertothepost

officebyputtingitinthemailboxattheendofyourdriveway,

bringingittothepostoffice,ordroppingitoffinamailboxset

uptoreceiveletters.Inanycase,youprobablygiveyour

outgoingletterstothepostofficeinprettymuchthesameway

everytimeyousendaletter.Withe-mail,thee-mailsoftware

onyourPCsendstheoutgoinge-mailtothesamee-mailserver

everytimeaswell,regardlessofwhotherecipientis.

AfterKeithandConner'se-mailservershavetheirrespectiveemails,theserverslookatthenameafterthe@sign,butthey

ignorethenamebeforethe@sign.Theirgoalistodeliverthe

e-mailtothee-mailserveratFredsco,andthepartafterthe@

identifiesthate-mailserver.It'smuchlikehowyourlocalpost

officejustlooksatthecityandstateonaletteryougivethem,

ortheyjustlookatthezipcode,tofigureouttowhichpost

officetosendtheletter.Thelocalpostofficedoesn'tcareabout

thenameofthepersonontheletterorthestreetaddress;it

justwantstosendthelettertoapostofficeneartherecipient.

TheISP1andISP2e-mailserversknowhowtofindthee-mail

serverforfredsco.combecausetheyaskanothertypeofserver

calledaDomainNameSystem(DNS)server.TheDNSserver

tellsthee-mailservershowtofindtheothere-mailservers.

Chapter13,"PeopleLikeNames,butComputersLikeNumbers,"

coversthedetailsaboutDNSservers.Fornow,justknowthat

theycanindeedfindothere-mailserverseasily.

Finally,aftertheFredscoe-mailservergetsthee-mails,itholds

thee-mail,waitingontheuserstocheckthemail.Whenthe

personwhousesthesales@fredsco.comaccountcheckshisemail,theFredscoe-mailservermustchecktheentiree-mail



addressofalle-mailitisholdingfordelivery.Thee-mailswith

usernamesalesgetdeliveredtothatPC.Likewise,whenuser

fredcheckshise-mail,Fredsco'se-mailserverdeliversthemail

toFred.



Rules,Schmools:EvenMoreRules?

Nowthatyouhavethegeneralideaofhowe-mailworks,you

shouldknowaboutafewoftheprotocolsandstandardsforemail.First,Table8-1liststhestandards.Afterward,I'llexplaina

littleabouteach.

Table8-1.TCP/IPE-MailStandards

Standard



RFC



Description



InternetMessageFormat 2822



Definestheheadersusedtoencapsulate

thee-mailtext,includingthesenderand

receivere-mailaddresses



SimpleMailTransport

Protocol(SMTP)



2821



Definesprotocolsfortransmittingand

receivinge-mails



PostOfficeProtocol

Version3(POP3)



1939



Definesprotocolsforaclienttoretrieveemailfromaserver



note

TCP/IPincludesthousandsofdifferentprotocolsandstandards,which

aredefinedindocumentscalledRequestsforComments(RFCs).Table

8-1liststhecommonnamesforthreeoftheprotocols,alongwiththeir

RFCnumbers.YoucangototheInternetEngineeringTaskForce(IETF)

websiteathttp://www.ietf.org/rfc.htmlusingawebbrowserifyou

wouldliketoreadmoreabouttheseorotherRFCs.



TheprotocolsshowninTable8-1happentobeapplicationlayer

protocolsaccordingtotheTCP/IPmodel.Interestingly,thereis

animportantdistinctionherebetweentheapplicationitselfand

theapplicationlayerprotocol.Figure8-4providesagood

backdroptodiscusstheconcept.



Figure8-4.E-MailClientApplicationandItsUse

ofApplicationLayerProtocols



Auserusese-mailclientsoftwaretogenerate,send,receive,

andreade-mails.Thee-mailclientmustdoworkthathas

nothingtodowithcommunication.Itmusthaveauser

interface,accepttexttypedfromthekeyboard,understand

whatauserclicksonthescreen,storee-mailsonthecomputer

harddisk,andsoon.Noneofthosetasksrequiresanetwork.

Thee-mailclientalsoneedstousethenetwork.Todoso,the

peoplewhowrotethee-mailclientsoftwarehadtoread,

understand,andimplemente-mailTCP/IPprotocolsintheemailclientsoftware.So,thee-mailclientapplicationisnotthe

samethingastheapplicationlayerprotocol;rather,to

communicate,thee-mailclientmustimplementthecorrect

applicationlayere-mailprotocols.



ProtocolsforAddressingtheEnvelopeCorrectly:Internet

MessageFormats

Whenane-mailclientsendsane-mailandthee-mailservers

forwardit,theynotonlysendthetextofthee-mailmessage,

butalsoaheader.Theheadercontainsseveralfields,including

therecipient'sandsender'se-mailaddresses,asshownin

Figure8-5.



Figure8-5.SamplingoftheE-MailHeaderDefined

byRFC2822



RFC2822,"InternetMessageFormats,"definesthe,well,uh,

formatofInternete-mailmessages.Yes,thenameisabitselfdefining.RFC2822definestheheaderfieldsshowninFigure85,andmanymore,sothatalltheclientsandserversknow

wheretofindalltheinformationneededtoforwardthee-mail

correctly.



TheKISSPrincipleandSMTP

TheKISSprinciplereferstoawiseadagetoKeepItSimple,

Stupid.Muchofwhatyoudoeverydaymightbebetterdoneif

youmakeituncomplicated.Oneofthemostpopulare-mail

protocolsalsotriestokeepthingssimple:SimpleMail

TransferProtocol,orSMTP.

E-mailclientsandserversuseSMTPprotocolstomanagethe

processofsendingandreceivinge-mail.Asitturnsout,instead

ofjustsendingane-mailwiththecorrectRFC2822header

aroundit,thee-mailclientsandserversneedtotalkaboutit

first.Forinstance,aclientshouldidentifyitselftotheserver

beforesendingane-mail.Also,thesenderofthee-mailshould

identifytherecipientbeforesendingthee-mail;thatway,ifthe

nextclient/serverinthepathcannotdeliverthee-mail,youdo

notwastetimeforwardingthee-mail.Figure8-6outlinesthe

process.



Figure8-6.SimpleSMTPMessages:Identifying

theClientandtheRecipient



[Viewfullsizeimage]



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Chapter 8. Shipping Goods over a (Network) Roadway

Tải bản đầy đủ ngay(0 tr)

×