TCPIP tutorial RFC 1180Word文档格式.docx
《TCPIP tutorial RFC 1180Word文档格式.docx》由会员分享,可在线阅读,更多相关《TCPIP tutorial RFC 1180Word文档格式.docx(43页珍藏版)》请在冰点文库上搜索。
particularlyonthestepsinforwardinganIPdatagramfromsource
hosttodestinationhostthrougharouter.Itdoesnotspecifyan
Internetstandard.Distributionofthismemoisunlimited.
TableofContents
1.Introduction................................................1
2.TCP/IPOverview.............................................2
3.Ethernet....................................................8
4.ARP.........................................................9
5.InternetProtocol...........................................12
6.UserDatagramProtocol......................................22
7.TransmissionControlProtocol...............................24
8.NetworkApplications........................................25
9.OtherInformation...........................................27
10.References..................................................27
11.RelationtootherRFCs......................................27
12.SecurityConsiderations.....................................27
13.Authors'
Addresses..........................................28
1.Introduction
ThistutorialcontainsonlyoneviewofthesalientpointsofTCP/IP,
andthereforeitisthe"
barebones"
ofTCP/IPtechnology.Itomits
thehistoryofdevelopmentandfunding,thebusinesscaseforits
use,anditsfutureascomparedtoISOOSI.Indeed,agreatdealof
technicalinformationisalsoomitted.Whatremainsisaminimumof
informationthatmustbeunderstoodbytheprofessionalworkingina
TCP/IPenvironment.Theseprofessionalsincludethesystems
administrator,thesystemsprogrammer,andthenetworkmanager.
ThistutorialusesexamplesfromtheUNIXTCP/IPenvironment,however
themainpointsapplyacrossallimplementationsofTCP/IP.
Notethatthepurposeofthismemoisexplanation,notdefinition.
Ifanyquestionarisesaboutthecorrectspecificationofaprotocol,
pleaserefertotheactualstandardsdefiningRFC.
Socolofsky&
Kale[Page1]
RFC1180ATCP/IPTutorialJanuary1991
ThenextsectionisanoverviewofTCP/IP,followedbydetailed
descriptionsofindividualcomponents.
2.TCP/IPOverview
Thegenericterm"
TCP/IP"
usuallymeansanythingandeverything
relatedtothespecificprotocolsofTCPandIP.Itcaninclude
otherprotocols,applications,andeventhenetworkmedium.Asample
oftheseprotocolsare:
UDP,ARP,andICMP.Asampleofthese
applicationsare:
TELNET,FTP,andrcp.Amoreaccuratetermis
"
internettechnology"
.Anetworkthatusesinternettechnologyis
calledan"
internet"
.
2.1BasicStructure
Tounderstandthistechnologyyoumustfirstunderstandthefollowing
logicalstructure:
----------------------------
|networkapplications|
||
|...\|/..\|/...|
|----------|
||TCP||UDP||
|\/|
|--------|
||IP||
|------*------|
||ARP|||
|-----||
|\||
|------|
||ENET||
|---@--|
----------|-----------------
|
----------------------o---------
EthernetCable
Figure1.BasicTCP/IPNetworkNode
Thisisthelogicalstructureofthelayeredprotocolsinsidea
computeronaninternet.Eachcomputerthatcancommunicateusing
internettechnologyhassuchalogicalstructure.Itisthislogical
structurethatdeterminesthebehaviorofthecomputeronthe
internet.Theboxesrepresentprocessingofthedataasitpasses
throughthecomputer,andthelinesconnectingboxesshowthepathof
Kale[Page2]
data.ThehorizontallineatthebottomrepresentstheEthernet
cable;
the"
o"
isthetransceiver.The"
*"
istheIPaddressandthe
@"
istheEthernetaddress.Understandingthislogicalstructureis
essentialtounderstandinginternettechnology;
itisreferredto
throughoutthistutorial.
2.2Terminology
Thenameofaunitofdatathatflowsthroughaninternetis
dependentuponwhereitexistsintheprotocolstack.Insummary:
if
itisonanEthernetitiscalledanEthernetframe;
ifitisbetween
theEthernetdriverandtheIPmoduleitiscalledaIPpacket;
ifit
isbetweentheIPmoduleandtheUDPmoduleitiscalledaUDP
datagram;
ifitisbetweentheIPmoduleandtheTCPmoduleitis
calledaTCPsegment(moregenerally,atransportmessage);
andifit
isinanetworkapplicationitiscalledaapplicationmessage.
Thesedefinitionsareimperfect.Actualdefinitionsvaryfromone
publicationtothenext.Morespecificdefinitionscanbefoundin
RFC1122,section1.3.3.
Adriverissoftwarethatcommunicatesdirectlywiththenetwork
interfacehardware.Amoduleissoftwarethatcommunicateswitha
driver,withnetworkapplications,orwithanothermodule.
Thetermsdriver,module,Ethernetframe,IPpacket,UDPdatagram,
TCPmessage,andapplicationmessageareusedwhereappropriate
2.3FlowofData
Let'
sfollowthedataasitflowsdownthroughtheprotocolstack
showninFigure1.ForanapplicationthatusesTCP(Transmission
ControlProtocol),datapassesbetweentheapplicationandtheTCP
module.ForapplicationsthatuseUDP(UserDatagramProtocol),data
passesbetweentheapplicationandtheUDPmodule.FTP(File
TransferProtocol)isatypicalapplicationthatusesTCP.Its
protocolstackinthisexampleisFTP/TCP/IP/ENET.SNMP(Simple
NetworkManagementProtocol)isanapplicationthatusesUDP.Its
protocolstackinthisexampleisSNMP/UDP/IP/ENET.
TheTCPmodule,UDPmodule,andtheEthernetdriveraren-to-1
multiplexers.Asmultiplexerstheyswitchmanyinputstooneoutput.
Theyarealso1-to-nde-multiplexers.Asde-multiplexerstheyswitch
oneinputtomanyoutputsaccordingtothetypefieldintheprotocol
header.
Kale[Page3]
123...n123...n
\|/|\||/^
\||/|\||/|
-------------flow----------------flow
|multiplexer|of|de-multiplexer|of
-------------data----------------data
||||
|v||
11
Figure2.n-to-1multiplexerand1-to-nde-multiplexer
IfanEthernetframecomesupintotheEthernetdriveroffthe
network,thepacketcanbepassedupwardstoeithertheARP(Address
ResolutionProtocol)moduleortotheIP(InternetProtocol)module.
ThevalueofthetypefieldintheEthernetframedetermineswhether
theEthernetframeispassedtotheARPortheIPmodule.
IfanIPpacketcomesupintoIP,theunitofdataispassedupwards
toeitherTCPorUDP,asdeterminedbythevalueoftheprotocol
fieldintheIPheader.
IftheUDPdatagramcomesupintoUDP,theapplicationmessageis
passedupwardstothenetworkapplicationbasedonthevalueofthe
portfieldintheUDPheader.IftheTCPmessagecomesupintoTCP,
theapplicationmessageispassedupwardstothenetworkapplication
basedonthevalueoftheportfieldintheTCPheader.
Thedownwardsmultiplexingissimpletoperformbecausefromeach
startingpointthereisonlytheonedownwardpath;
eachprotocol
moduleaddsitsheaderinformationsothepacketcanbede-
multiplexedatthedestinationcomputer.
DatapassingoutfromtheapplicationsthrougheitherTCPorUDP
convergesontheIPmoduleandissentdownwardsthroughthelower
networkinterfacedriver.
Althoughinternettechnologysupportsmanydifferentnetworkmedia,
Ethernetisusedforallexamplesinthistutorialbecauseitisthe
mostcommonphysicalnetworkusedunderIP.ThecomputerinFigure1
hasasingleEthernetconnection.The6-byteEthernetaddressis
uniqueforeachinterfaceonanEthernetandislocatedatthelower
interfaceoftheEthernetdriver.
Thecomputeralsohasa4-byteIPaddress.Thisaddressislocated
atthelowerinterfacetotheIPmodule.TheIPaddressmustbe
uniqueforaninternet.
Kale[Page4]
ArunningcomputeralwaysknowsitsownIPaddressandEthernet
address.
2.4TwoNetworkInterfaces
Ifacomputerisconnectedto2separateEthernetsitisasinFigure
3.
|------*----*------|
||ARP||||ARP||
|-----||-----|
|\||/|
|------------|
||ENET||ENET||
|---@-----@--|
----------|-------|---------
|---o---------------------------
|EthernetCable2
---------------o----------
EthernetCable1
Figure3.TCP/IPNetworkNodeon2Ethernets
Pleasenotethatthiscomputerhas2Ethernetaddressesand2IP
addresses.
Itisseenfromthisstructurethatforcomputerswithmorethanone
physicalnetworkinterface,theIPmoduleisbothan-to-m
multiplexerandanm-to-nde-multiplexer.
Kale[Page5]
\||/|\||/^
/||\|/||\|
/||\v/||\|
123...m123...m
Figure4.n-to-mmultiplexerandm-to-nde-multiplexer
Itperformsth