Tải bản đầy đủ - 0 (trang)
Chapter 24. TCP: Transmission Control Protocol

Chapter 24. TCP: Transmission Control Protocol

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

Chapter24.TCP:Transmission

ControlProtocol

Section24.1.Introduction

Section24.2.CodeIntroduction

Section24.3.TCPprotoswStructure

Section24.4.TCPHeader

Section24.5.TCPControlBlock







Section24.6.TCPStateTransition

Diagram

Section24.7.TCPSequenceNumbers

Section24.8.tcp_initFunction

Section24.9.Summary



Team-Fly









Top



Team-Fly











TCP/IPIllustrated,Volume2:The

ImplementationByGaryR.Wright,

W.RichardStevens

TableofContents



Chapter24.TCP:Transmission

ControlProtocol



24.1Introduction

TheTransmissionControlProtocol,orTCP,

providesaconnection-oriented,reliable,

byte-streamservicebetweenthetwoend

pointsofanapplication.Thisiscompletely

differentfromUDP'sconnectionless,

unreliable,datagramservice.

TheimplementationofUDPpresentedin

Chapter23comprised9functionsand

about800linesofCcode.TheTCP

implementationwe'reabouttodescribe

comprises28functionsandalmost4,500

linesofCcode.Thereforewedividethe

presentationofTCPintomultiplechapters.







Thesechaptersarenotanintroductionto

TCP.Weassumethereaderisfamiliarwith

theoperationofTCPfromChapters17-24

ofVolume1.



Team-Fly









Top



Team-Fly











TCP/IPIllustrated,Volume2:The

ImplementationByGaryR.Wright,

W.RichardStevens

TableofContents



Chapter24.TCP:Transmission

ControlProtocol



24.2CodeIntroduction

TheTCPfunctionsappearinsixCfilesand

numerousTCPdefinitionsareinseven

headers,asshowninFigure24.1.



Figure24.1.FilesdiscussedintheTCP

chapters.



Figure24.2showstherelationshipofthe

variousTCPfunctionstootherkernel

functions.Theshadedellipsesarethenine

mainTCPfunctionsthatwecover.Eightof

thesefunctionsappearintheTCPprotosw

structure(Figure24.8)andtheninthis

tcp_output.



Figure24.2.RelationshipofTCP

functionstorestofthekernel.



GlobalVariables

Figure24.3showstheglobalvariableswe



encounterthroughouttheTCPfunctions.



Figure24.3.Globalvariablesintroduced

inthefollowingchapters.



Statistics

VariousTCPstatisticsaremaintainedin

theglobalstructuretcpstat,describedin

Figure24.4.We'llseewherethese

countersareincrementedasweproceed

throughthecode.



Figure24.4.TCPstatisticsmaintainedin

thetcpstatstructure.



Figure24.5showssomesampleoutputof

thesestatistics,fromthenetstats

command.Thesestatisticswerecollected

afterthehosthadbeenupfor30days.

Sincesomecounterscomeinpairsone

countsthenumberofpacketsandthe







otherthenumberofbytesweabbreviate

theseinthefigure.Forexample,thetwo

countersforthesecondlineofthetable

aretcps_sndpackandtcps_sndbyte.



Figure24.5.SampleTCPstatistics.



Thecounterfortcps_sndbyteshouldbe

3,722,884,824,not-22,194,928bytes.

Thisisanaverageofabout405bytes



persegment,whichmakessense.

Similarly,thecounterfor

tcps_rcvackbyteshouldbe

3,738,811,552,not-21,264,360bytes

(foranaverageofabout565bytesper

segment).Thesenumbersare

incorrectlyprintedasnegativenumbers

becausetheprintfcallsinthenetstat

programuse%d(signeddecimal)

insteadof%lu(longinteger,unsigned

decimal).Allthecountersareunsigned

longintegers,andthesetwocounters

arenearthemaximumvalueofan

unsigned32-bitlonginteger

(2321=4,294,967,295).



SNMPVariables

Figure24.6showsthe14simpleSNMP

variablesintheTCPgroupandthe

countersfromthetcpstatstructure

implementingthatvariable.Theconstant

valuesshownforthefirstfourentriesare

fixedbytheNet/3implementation.The

countertcpCurrEstabiscomputedasthe

numberofInternetPCBsontheTCPPCB

list.



Figure24.6.SimpleSNMPvariablesin

tcpgroup.



Figure24.7showstcpTable,theTCP

listenertable.



Figure24.7.VariablesinTCPlistener

table:tcpTable.



ThefirstPCBvariable(t_state)isfromthe

TCPcontrolblock(Figure24.13)andthe

remainingfourarefromtheInternetPCB

(Figure22.4).



Team-Fly









Top



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

Chapter 24. TCP: Transmission Control Protocol

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

×