Tải bản đầy đủ - 0 (trang)
Chapter 23. UDP: User Datagram Protocol

Chapter 23. UDP: User Datagram Protocol

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

Chapter23.UDP:User

DatagramProtocol

Section23.1.Introduction

Section23.2.CodeIntroduction

Section23.3.UDPprotoswStructure

Section23.4.UDPHeader

Section23.5.udp_initFunction

Section23.6.udp_outputFunction





Section23.7.udp_inputFunction

Section23.8.udp_saveoptFunction

Section23.9.udp_ctlinputFunction

Section23.10.udp_usrreqFunction

Section23.11.udp_sysctlFunction

Section23.12.Implementation

Refinements



Section23.13.Summary



Team-Fly









Top



Team-Fly











TCP/IPIllustrated,Volume2:The

ImplementationByGaryR.Wright,

W.RichardStevens

TableofContents



Chapter23.UDP:UserDatagram

Protocol



23.1Introduction

TheUserDatagramProtocol,orUDP,isa

simple,datagram-oriented,transport-layer

protocol:eachoutputoperationbya

processproducesexactlyoneUDP

datagram,whichcausesoneIPdatagram

tobesent.

AprocessaccessesUDPbycreatinga

socketoftypeSOCK_DGRAMinthe

Internetdomain.Bydefaultthesocketis

termedunconnected.Eachtimethe

processsendsadatagramitmustspecify

thedestinationIPaddressandport

number.Eachtimeadatagramisreceived

forthesocket,theprocesscanreceivethe







sourceIPaddressandportnumberfrom

thedatagram.

WementionedinSection22.5thataUDP

socketcanalsobeconnectedtoone

particularIPaddressandportnumber.

Thiscausesalldatagramswrittentothe

sockettogotothatdestination,andonly

datagramsarrivingfromthatIPaddress

andportnumberarepassedtothe

process.

Thischapterexaminestheimplementation

ofUDP.



Team-Fly









Top



Team-Fly











TCP/IPIllustrated,Volume2:The

ImplementationByGaryR.Wright,

W.RichardStevens

TableofContents



Chapter23.UDP:UserDatagram

Protocol



23.2CodeIntroduction

TherearenineUDPfunctionsinasingleC

fileandvariousUDPdefinitionsintwo

headers,asshowninFigure23.1.



Figure23.1.Filesdiscussedinthis

chapter.



Figure23.2showstherelationshipofthe

sixmainUDPfunctionstootherkernel

functions.Theshadedellipsesarethesix



functionsthatwecoverinthischapter.We

alsocoverthreeadditionalUDPfunctions

thatarecalledbysomeofthesesix

functions.



Figure23.2.RelationshipofUDP

functionstorestofkernel.



GlobalVariables

Sevenglobalvariablesareintroducedin

thischapter,whichareshowninFigure

23.3.



Figure23.3.Globalvariablesintroduced

inthischapter.



Statistics

VariousUDPstatisticsaremaintainedin

theglobalstructureudpstat,describedin

Figure23.4.We'llseewherethese

countersareincrementedasweproceed

throughthecode.



Figure23.4.UDPstatisticsmaintainedin

theudpstatstructure.



Figure23.5showssomesampleoutputof

thesestatistics,fromthenetstat-s

command.







Figure23.5.SampleUDPstatistics.



ThenumberofUDPdatagramsdelivered

(thesecondfromlastlineofoutput)isthe

numberofdatagramsreceived

(udps_ipackets)minusthesixvariables

thatprecedeitinFigure23.5.



SNMPVariables

Figure23.6showsthefoursimpleSNMP

variablesintheUDPgroupandwhich

countersfromtheudpstatstructure

implementthatvariable.



Figure23.6.SimpleSNMPvariablesin

udpgroup.



Figure23.7showstheUDPlistenertable,

namedudpTable.Thevaluesreturnedby

SNMPforthistablearetakenfromaUDP

PCB,nottheudpstatstructure.



Figure23.7.VariablesinUDPlistener

table:udpTable.



Team-Fly









Top



Team-Fly











TCP/IPIllustrated,Volume2:The

ImplementationByGaryR.Wright,

W.RichardStevens

TableofContents



Chapter23.UDP:UserDatagram

Protocol



23.3UDPprotoswStructure

Figure23.8liststheprotocolswitchentry

forUDP.



Figure23.8.TheUDPprotoswstructure.





Wedescribethefivefunctionsthatbegin



withudp_inthischapter.Wealsocovera

sixthfunction,udp_output,whichisnotin

theprotocolswitchentrybutiscalledby

udp_usrreqwhenaUDPdatagramis

output.



Team-Fly









Top



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

Chapter 23. UDP: User Datagram Protocol

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

×