SCTP包格式

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

SCTPPacketFormat16bits16bitsSourcePortNumber(16bits)DestinationPortNumber(16bits)VerificationTag(32bits)Checksum(32bits)ChunkType(8bits)ChunkFlags(8bits)ChunkLength(16bits)ChunkValue(variablelength)ChunkType(8bits)ChunkFlags(8bits)ChunkLength(16bits)ChunkValue(variablelength)...ChunkType(8bits)ChunkFlags(8bits)ChunkLength(16bits)ChunkValue(variablelength)1.AnSCTPpacketiscomposedofacommonheaderandchunks.MultiplechunkscanbebundledintooneSCTPpacketuptotheMTUsize.INIT,INITACK,andSHUTDOWNCOMPLETEchunksMUSTNOTbebundledwithanyotherchunkinapacket.Ifauserdatamessagedoesn’tfitintooneSCTPpacketitcanbefragmentedintomultiplechunks.AllintegerfieldsinanSCTPpacketMUSTbetransmittedinnetworkbyteorder,unlessotherwisestated.2.SCTPcommonheaderformatSourcePortNumber(16bits)DestinationPortNumber(16bits)VerificationTag(32bits)Checksum(32bits)SourcePortNumber:16bits(unsignedinteger)DestinationPortNumber:16bits(unsignedinteger)VerificationTag:32bits(unsignedinteger)Ontransmit,thevalueofthisVerificationTagMUSTbesettothevalueoftheInitiateTagreceivedfromthepeerendpointduringtheassociationInitialization.Commonheader(96bits,12bytes)Chunk#1Chunk#2...Chunk#nCommonHeaderChunk#1Chunk#2Chunk#nApacketcontaininganINITchunkMUSThaveazeroVerificationTag.ApacketcontainingaSHUTDOWNCOMPLETEchunkwiththeTbitsetMUSThavetheVerificationTagcopiedfromthepacketwiththeSHUTDOWNACKchunk.ApacketcontaininganABORTchunkmayhavetheverificationtagcopiedfromthepacketthatcausedtheABORTtobesent.Checksum:32bits(unsignedinteger)SCTPusestheCRC32calgorithmforcalculatingthechecksum.3.Achunkcontainseithercontrolinformationoruserdata.ChunkType(8bits)ChunkFlag(8bits)ChunkLength(16bits)ChunkValueChunkType:8bits(unsignedinteger)0...2540-PayloadData(DATA)1-Initiation(INIT)2-InitiationAcknowledgement(INITACK)3-SelectiveAcknowledgement(SACK)4-HeartbeatRequest(HEARTBEAT)5-HeartbeatAcknowledgement(HEARTBEATACK)6-Abort(ABORT)7-Shutdown(SHUTDOWN)8-ShutdownAcknowledgement(SHUTDOWNACK)9-OperationError(ERROR)10-StateCookie(COOKIEECHO)11-CookieAcknowledgement(COOKIEACK)12-ReservedforExplicitCongestionNotificationEcho(ECNE)13-ReservedforCongestionWindowReduced(CWR)14-ShutdownComplete(SHUTDOWNCOMPLETE)15to62-available63-reservedforIETF-definedChunkExtensions64to126-available127-reservedforIETF-definedChunkExtensions128to190-available191-reservedforIETF-definedChunkExtensions192to254-available255-reservedforIETF-definedChunkExtensionsChunkTypesareencodedsuchthatthehighest-order2bitsspecifytheactionthatmustbetakeniftheprocessingendpointdoesnotrecognizetheChunkType.00-StopprocessingthisSCTPpacketanddiscardit,donotprocessanyfurtherchunkswithinit.01-StopprocessingthisSCTPpacketanddiscardit,donotprocessanyfurtherchunkswithinit,andreporttheunrecognizedchunkinan’UnrecognizedChunkType’.10-Skipthischunkandcontinueprocessing.11-Skipthischunkandcontinueprocessing,butreportinanERRORchunkusingthe’UnrecognizedChunkType’causeofError.ChunkFlags:8bitsTheusageofthesebitsdependsontheChunktypeasgivenbytheChunkTypefield.Unlessotherwisespecified,theyaresetto0ontransmitandareignoredonreceipt.ChunkLength:16bits(unsignedinteger)Thisvaluerepresentsthesizeofthechunkinbytes,includingtheChunkType,ChunkFlags,ChunkLength,andChunkValuefields.Therefore,iftheChunkValuefieldiszero-length,theLengthfieldwillbesetto4.TheChunkLengthfielddoesnotcountanychunkpadding.Chunks(includingType,Length,andValuefields)arepaddedoutbythesenderwithallzerobytestobeamultipleof4byteslong.ThispaddingMUSTNOTbemorethan3bytesintotal.TheChunkLengthvaluedoesnotincludeterminatingpaddingofthechunk.However,itdoesincludepaddingofanyvariable-lengthparameterexceptthelastparameterinthechunk.ThereceiverMUSTignorethepadding.ChunkValue:variablelengthTheChunkValuefieldcontainstheactualinformationtobetransferredinthechunk.TheusageandformatofthisfieldisdependentontheChunkType.Thetotallengthofachunk(includingType,Length,andValuefields)MUSTbeamultipleof4bytes.Ifthelengthofthechunkisnotamultipleof4bytes,thesenderMUSTpadthechunkwithallzerobytes.4.ChunkValuesofSCTPcontrolchunksChunkvaluesofSCTPcontrolchunksconsistofachunk-type-specificheaderofrequiredfields,followedbyzeroormoreparameters.ChunkParameterFormatParameterType(16bits)ParameterLength(16bits)ParameterValue(variablelength)ChunkParameterType:16bits(unsignedinteger)0...65534Thevalueof65535isreservedforIETF-definedextensions.ValuesotherthanthosedefinedinspecificSCTPchunkdescriptionsarereservedforusebyIETF.ChunkParameterLength:16bits(unsignedinteger)TheParameterLengthfieldcontainsthesizeoftheparameterinbytes,includingtheParameterType,ParameterLength,andParameterValuefields.Thus,aparameterwithazero-lengthParameterValuefieldwouldhaveaLengthfieldof4.TheParameterLengthdoesnotincludeanypaddingbytes.ChunkParameterValue:variablelengthTheParameterValuefieldcontainstheactualinformationtobetransferredintheparameter.Thetotallengthofaparameter(includingType,ParameterLength,andValuefields)MUSTbeamultipleof4bytes.Ifthelengthoftheparameterisnotamultipleof4bytes,thesenderpadstheparameterattheend(i.e.,aftert

1 / 8
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功