|
INET Framework for OMNeT++/OMNEST
|
#include <SctpAssociation.h>
|
| static const char * | indicationName (int32_t code) |
| | Utility: returns name of SCTP_I_xxx constants. More...
|
| |
| static int | getAddressLevel (const L3Address &addr) |
| | Utility: return IPv4 or IPv6 address level. More...
|
| |
| static const char * | stateName (int32_t state) |
| | Utility: returns name of SCTP_S_xxx constants. More...
|
| |
| static uint16_t | chunkToInt (const char *type) |
| |
| static bool | SCTP_UINT16_GT (uint16_t a, uint16_t b) |
| | Compare TSNs. More...
|
| |
| static bool | SCTP_UINT16_GE (uint16_t a, uint16_t b) |
| |
| static bool | SCTP_UINT32_GT (uint32_t a, uint32_t b) |
| |
| static bool | SCTP_UINT32_GE (uint32_t a, uint32_t b) |
| |
| static bool | tsnGe (const uint32_t tsn1, const uint32_t tsn2) |
| |
| static bool | tsnGt (const uint32_t tsn1, const uint32_t tsn2) |
| |
| static bool | tsnLe (const uint32_t tsn1, const uint32_t tsn2) |
| |
| static bool | tsnLt (const uint32_t tsn1, const uint32_t tsn2) |
| |
| static bool | tsnBetween (const uint32_t tsn1, const uint32_t midtsn, const uint32_t tsn2) |
| |
| static bool | ssnGt (const uint16_t ssn1, const uint16_t ssn2) |
| |
| static bool | midGt (const uint32_t mid1, const uint32_t mid2) |
| |
|
|
| SctpEventCode | preanalyseAppCommandEvent (int32_t commandCode) |
| | Maps app command codes (msg kind of app command msgs) to SCTP_E_xxx event codes. More...
|
| |
| bool | performStateTransition (const SctpEventCode &event) |
| | Implemements the pure SCTP state machine. More...
|
| |
| void | stateEntered (int32_t state) |
| |
|
| void | process_ASSOCIATE (SctpEventCode &event, SctpCommandReq *sctpCommand, cMessage *msg) |
| |
| void | process_OPEN_PASSIVE (SctpEventCode &event, SctpCommandReq *sctpCommand, cMessage *msg) |
| |
| void | process_SEND (SctpEventCode &event, SctpCommandReq *sctpCommand, cMessage *msg) |
| |
| void | process_CLOSE (SctpEventCode &event) |
| |
| void | process_ABORT (SctpEventCode &event) |
| |
| void | process_STATUS (SctpEventCode &event, SctpCommandReq *sctpCommand, cMessage *msg) |
| |
| void | process_RECEIVE_REQUEST (SctpEventCode &event, SctpCommandReq *sctpCommand) |
| |
| void | process_PRIMARY (SctpEventCode &event, SctpCommandReq *sctpCommand) |
| |
| void | process_STREAM_RESET (SctpCommandReq *sctpCommand) |
| |
|
| bool | process_RCV_Message (SctpHeader *sctpmsg, const L3Address &src, const L3Address &dest) |
| |
| bool | processInitArrived (SctpInitChunk *initChunk, int32_t sport, int32_t dport) |
| | Process incoming SCTP packets. More...
|
| |
| bool | processInitAckArrived (SctpInitAckChunk *initAckChunk) |
| |
| bool | processCookieEchoArrived (SctpCookieEchoChunk *cookieEcho, L3Address addr) |
| |
| bool | processCookieAckArrived () |
| |
| SctpEventCode | processDataArrived (SctpDataChunk *dataChunk) |
| |
| SctpEventCode | processSackArrived (SctpSackChunk *sackChunk) |
| |
| SctpEventCode | processHeartbeatAckArrived (SctpHeartbeatAckChunk *heartbeatack, SctpPathVariables *path) |
| |
| SctpEventCode | processForwardTsnArrived (SctpForwardTsnChunk *forChunk) |
| |
| bool | processPacketDropArrived (SctpPacketDropChunk *pktdrop) |
| |
| void | processErrorArrived (SctpErrorChunk *error) |
| |
|
| SSFunctions | ssFunctions |
| |
| uint16_t | ssModule |
| |
| void | process_TIMEOUT_RTX (SctpPathVariables *path) |
| |
| void | process_TIMEOUT_BLOCKING (SctpPathVariables *path) |
| |
| void | process_TIMEOUT_HEARTBEAT (SctpPathVariables *path) |
| |
| void | process_TIMEOUT_HEARTBEAT_INTERVAL (SctpPathVariables *path, bool force) |
| |
| void | process_TIMEOUT_INIT_REXMIT (SctpEventCode &event) |
| |
| void | process_TIMEOUT_PROBING () |
| |
| void | process_TIMEOUT_SHUTDOWN (SctpEventCode &event) |
| |
| int32_t | updateCounters (SctpPathVariables *path) |
| |
| void | process_TIMEOUT_RESET (SctpPathVariables *path) |
| |
| void | process_TIMEOUT_ASCONF (SctpPathVariables *path) |
| |
| void | startTimer (cMessage *timer, const simtime_t &timeout) |
| |
| SctpAssociation * | cloneAssociation () |
| | Utility: clone a listening association. More...
|
| |
| void | initAssociation (SctpOpenReq *openCmd) |
| | Utility: creates send/receive queues and sctpAlgorithm. More...
|
| |
| bool | tsnIsDuplicate (const uint32_t tsn) const |
| | Methods dealing with the handling of TSNs
More...
|
| |
| bool | makeRoomForTsn (const uint32_t tsn, const uint32_t length, const bool uBit) |
| |
| void | sendInit () |
| | Methods for creating and sending chunks. More...
|
| |
| void | sendInitAck (SctpInitChunk *initchunk) |
| |
| void | sendCookieEcho (SctpInitAckChunk *initackchunk) |
| |
| void | sendCookieAck (const L3Address &dest) |
| |
| void | sendAbort (uint16_t tBit=0) |
| |
| void | sendHeartbeat (const SctpPathVariables *path) |
| |
| void | sendHeartbeatAck (const SctpHeartbeatChunk *heartbeatChunk, const L3Address &src, const L3Address &dest) |
| |
| void | sendSack () |
| |
| void | sendShutdown () |
| |
| void | sendShutdownAck (const L3Address &dest) |
| |
| void | sendShutdownComplete () |
| |
| SctpSackChunk * | createSack () |
| |
| void | retransmitInit () |
| | Retransmitting chunks. More...
|
| |
| void | retransmitCookieEcho () |
| |
| void | retransmitReset () |
| |
| void | retransmitShutdown () |
| |
| void | retransmitShutdownAck () |
| |
| void | sendToIP (Packet *pkt, const Ptr< SctpHeader > &sctpmsg, L3Address dest) |
| | Utility: adds control info to message and sends it to IP. More...
|
| |
| void | sendToIP (Packet *pkt, const Ptr< SctpHeader > &sctpmsg) |
| |
| void | scheduleSack () |
| |
| void | signalConnectionTimeout () |
| | Utility: signal to user that connection timed out. More...
|
| |
| void | scheduleTimeout (cMessage *msg, const simtime_t &timeout) |
| | Utility: start a timer. More...
|
| |
| cMessage * | cancelEvent (cMessage *msg) |
| | Utility: cancel a timer. More...
|
| |
| void | sendToApp (cMessage *msg) |
| | Utility: sends packet to application. More...
|
| |
| void | sendIndicationToApp (int32_t code, int32_t value=0) |
| | Utility: sends status indication (SCTP_I_xxx) to application. More...
|
| |
| void | sendEstabIndicationToApp () |
| | Utility: sends SCTP_I_ESTABLISHED indication with SctpConnectInfo to application. More...
|
| |
| void | sendAvailableIndicationToApp () |
| |
| bool | isToBeAccepted () const |
| |
| void | pushUlp () |
| |
| void | sendDataArrivedNotification (uint16_t sid) |
| |
| void | putInDeliveryQ (uint16_t sid) |
| |
| void | printAssocBrief () |
| | Utility: prints local/remote addr/port and app gate index/assocId. More...
|
| |
| void | addPath (const L3Address &addr) |
| |
| SctpPathVariables * | getNextPath (const SctpPathVariables *oldPath) const |
| |
| const L3Address & | getNextAddress (const SctpPathVariables *oldPath) const |
| |
| SctpPathVariables * | getNextDestination (SctpDataVariables *chunk) const |
| |
| void | bytesAllowedToSend (SctpPathVariables *path, bool firstPass) |
| |
| void | pathStatusIndication (const SctpPathVariables *path, bool status) |
| |
| bool | allPathsInactive () const |
| |
| void | sendStreamResetRequest (SctpResetReq *info) |
| |
| void | sendStreamResetResponse (uint32_t srrsn, int result) |
| |
| void | sendStreamResetResponse (SctpSsnTsnResetRequestParameter *requestParam, int result, bool options) |
| |
| void | sendOutgoingResetRequest (SctpIncomingSsnResetRequestParameter *requestParam) |
| |
| void | sendAddOutgoingStreamsRequest (uint16_t numStreams) |
| |
| void | sendBundledOutgoingResetAndResponse (SctpIncomingSsnResetRequestParameter *requestParam) |
| |
| void | sendAddInAndOutStreamsRequest (SctpResetReq *info) |
| |
| void | sendDoubleStreamResetResponse (uint32_t insrrsn, uint16_t inresult, uint32_t outsrrsn, uint16_t outresult) |
| |
| void | checkStreamsToReset () |
| |
| bool | streamIsPending (int32_t sid) |
| |
| void | sendPacketDrop (const bool flag) |
| |
| void | sendHMacError (const uint16_t id) |
| |
| void | sendInvalidStreamError (uint16_t sid) |
| |
| void | resetGapLists () |
| |
| SctpForwardTsnChunk * | createForwardTsnChunk (const L3Address &pid) |
| |
| bool | msgMustBeAbandoned (SctpDataMsg *msg, int32_t stream, bool ordered) |
| |
| bool | chunkMustBeAbandoned (SctpDataVariables *chunk, SctpPathVariables *sackPath) |
| |
| void | advancePeerTsn () |
| |
| void | cucProcessGapReports (const SctpDataVariables *chunk, SctpPathVariables *path, const bool isAcked) |
| |
| SctpDataChunk * | transformDataChunk (SctpDataVariables *chunk) |
| | Manipulating chunks. More...
|
| |
| SctpDataVariables * | makeVarFromMsg (SctpDataChunk *datachunk) |
| |
| int32_t | streamScheduler (SctpPathVariables *path, bool peek) |
| | Dealing with streams. More...
|
| |
| void | initStreams (uint32_t inStreams, uint32_t outStreams) |
| |
| void | addInStreams (uint32_t inStreams) |
| |
| void | addOutStreams (uint32_t outStreams) |
| |
| int32_t | numUsableStreams () |
| |
| int32_t | streamSchedulerRoundRobinPacket (SctpPathVariables *path, bool peek) |
| |
| int32_t | streamSchedulerRandom (SctpPathVariables *path, bool peek) |
| |
| int32_t | streamSchedulerRandomPacket (SctpPathVariables *path, bool peek) |
| |
| int32_t | streamSchedulerFairBandwidth (SctpPathVariables *path, bool peek) |
| |
| int32_t | streamSchedulerFairBandwidthPacket (SctpPathVariables *path, bool peek) |
| |
| int32_t | streamSchedulerPriority (SctpPathVariables *path, bool peek) |
| |
| int32_t | streamSchedulerFCFS (SctpPathVariables *path, bool peek) |
| |
| int32_t | pathStreamSchedulerManual (SctpPathVariables *path, bool peek) |
| |
| int32_t | pathStreamSchedulerMapToPath (SctpPathVariables *path, bool peek) |
| |
| void | process_QUEUE_MSGS_LIMIT (const SctpCommandReq *sctpCommand) |
| | Queue Management. More...
|
| |
| void | process_QUEUE_BYTES_LIMIT (const SctpCommandReq *sctpCommand) |
| |
| int32_t | getOutstandingBytes () const |
| |
| void | dequeueAckedChunks (const uint32_t tsna, SctpPathVariables *path, simtime_t &rttEstimation) |
| |
| SctpDataMsg * | peekOutboundDataMsg () |
| |
| SctpDataVariables * | peekAbandonedChunk (const SctpPathVariables *path) |
| |
| SctpDataVariables * | getOutboundDataChunk (const SctpPathVariables *path, int32_t availableSpace, int32_t availableCwnd) |
| |
| void | fragmentOutboundDataMsgs () |
| |
| SctpDataMsg * | dequeueOutboundDataMsg (SctpPathVariables *path, int32_t availableSpace, int32_t availableCwnd) |
| |
| bool | nextChunkFitsIntoPacket (SctpPathVariables *path, int32_t bytes) |
| |
| void | putInTransmissionQ (uint32_t tsn, SctpDataVariables *chunk) |
| |
| uint32_t | getAllTransQ () |
| |
| void | pmStartPathManagement () |
| | Flow control. More...
|
| |
| void | pmDataIsSentOn (SctpPathVariables *path) |
| |
| void | pmClearPathCounter (SctpPathVariables *path) |
| |
| void | pmRttMeasurement (SctpPathVariables *path, const simtime_t &rttEstimation) |
| |
| void | disposeOf (SctpHeader *sctpmsg) |
| |
| void | removeFirstChunk (SctpHeader *sctpmsg) |
| |
| void | resetSsns () |
| | Methods for Stream Reset. More...
|
| |
| void | resetExpectedSsns () |
| |
| bool | sendStreamPresent (uint32_t sid) |
| |
| bool | receiveStreamPresent (uint32_t sid) |
| |
| void | resetSsn (uint16_t id) |
| |
| void | resetExpectedSsn (uint16_t id) |
| |
| uint32_t | getExpectedSsnOfStream (uint16_t id) |
| |
| uint32_t | getSsnOfStream (uint16_t id) |
| |
| SctpParameter * | makeOutgoingStreamResetParameter (uint32_t srsn, SctpResetReq *info) |
| |
| SctpParameter * | makeIncomingStreamResetParameter (uint32_t srsn, SctpResetReq *info) |
| |
| SctpParameter * | makeSsnTsnResetParameter (uint32_t srsn) |
| |
| SctpParameter * | makeAddStreamsRequestParameter (uint32_t srsn, SctpResetReq *info) |
| |
| void | sendOutgoingRequestAndResponse (uint32_t inRequestSn, uint32_t outRequestSn) |
| |
| void | sendOutgoingRequestAndResponse (SctpIncomingSsnResetRequestParameter *inRequestParam, SctpOutgoingSsnResetRequestParameter *outRequestParam) |
| |
| SctpEventCode | processInAndOutResetRequestArrived (SctpIncomingSsnResetRequestParameter *inRequestParam, SctpOutgoingSsnResetRequestParameter *outRequestParam) |
| |
| SctpEventCode | processOutAndResponseArrived (SctpOutgoingSsnResetRequestParameter *outRequestParam, SctpStreamResetResponseParameter *responseParam) |
| |
| SctpEventCode | processStreamResetArrived (SctpStreamResetChunk *strResChunk) |
| |
| void | processOutgoingResetRequestArrived (SctpOutgoingSsnResetRequestParameter *requestParam) |
| |
| void | processIncomingResetRequestArrived (SctpIncomingSsnResetRequestParameter *requestParam) |
| |
| void | processSsnTsnResetRequestArrived (SctpSsnTsnResetRequestParameter *requestParam) |
| |
| void | processResetResponseArrived (SctpStreamResetResponseParameter *responseParam) |
| |
| void | processAddInAndOutResetRequestArrived (const SctpAddStreamsRequestParameter *addInRequestParam, SctpAddStreamsRequestParameter *addOutRequestParam) |
| |
| uint32_t | getBytesInFlightOfStream (uint16_t sid) |
| |
| bool | getFragInProgressOfStream (uint16_t sid) |
| |
| void | setFragInProgressOfStream (uint16_t sid, bool frag) |
| |
| bool | orderedQueueEmptyOfStream (uint16_t sid) |
| |
| bool | unorderedQueueEmptyOfStream (uint16_t sid) |
| |
| void | sendAsconf (const char *type, bool remote=false) |
| | Methods for Add-IP and AUTH. More...
|
| |
| void | sendAsconfAck (uint32_t serialNumber) |
| |
| SctpEventCode | processAsconfArrived (SctpAsconfChunk *asconfChunk) |
| |
| SctpEventCode | processAsconfAckArrived (SctpAsconfAckChunk *asconfAckChunk) |
| |
| void | retransmitAsconf () |
| |
| bool | typeInChunkList (uint16_t type) |
| |
| bool | typeInOwnChunkList (uint16_t type) |
| |
| SctpAsconfAckChunk * | createAsconfAckChunk (uint32_t serialNumber) |
| |
| SctpAuthenticationChunk * | createAuthChunk () |
| |
| SctpSuccessIndication * | createSuccessIndication (uint32_t correlationId) |
| |
| void | calculateAssocSharedKey () |
| |
| bool | compareRandom () |
| |
| void | calculateRcvBuffer () |
| |
| void | listOrderedQ () |
| |
| void | tsnWasReneged (SctpDataVariables *chunk, const SctpPathVariables *sackPath, const int type) |
| |
| void | printOutstandingTsns () |
| |
| void | initCcParameters (SctpPathVariables *path) |
| | SctpCcFunctions. More...
|
| |
| void | updateFastRecoveryStatus (uint32_t lastTsnAck) |
| |
| void | cwndUpdateBeforeSack () |
| |
| void | cwndUpdateAfterSack () |
| |
| void | cwndUpdateAfterCwndTimeout (SctpPathVariables *path) |
| |
| void | cwndUpdateAfterRtxTimeout (SctpPathVariables *path) |
| |
| void | cwndUpdateMaxBurst (SctpPathVariables *path) |
| |
| void | cwndUpdateBytesAcked (SctpPathVariables *path, uint32_t ackedBytes, bool ctsnaAdvanced) |
| |
| int32_t | rpPathBlockingControl (SctpPathVariables *path, double reduction) |
| |
| static void | printSegmentBrief (SctpHeader *sctpmsg) |
| | Utility: prints important header fields. More...
|
| |
| static const char * | eventName (int32_t event) |
| | Utility: returns name of SCTP_E_xxx constants. More...
|
| |
| SctpDataVariables * | makeDataVarFromDataMsg (SctpDataMsg *datMsg, SctpPathVariables *path) |
| |
| SctpPathVariables * | choosePathForRetransmission () |
| |
| void | timeForSack (bool &sackOnly, bool &sackWithData) |
| |
| void | recordCwndUpdate (SctpPathVariables *path) |
| |
| void | sendSACKviaSelectedPath (const Ptr< SctpHeader > &sctpMsg) |
| |
| void | checkOutstandingBytes () |
| |
| void | updateHighSpeedCCThresholdIdx (SctpPathVariables *path) |
| |
| uint32_t | getInitialCwnd (const SctpPathVariables *path) const |
| |
| void | generateSendQueueAbatedIndication (uint64_t bytes) |
| |
| void | renegablyAckChunk (SctpDataVariables *chunk, SctpPathVariables *sackPath) |
| |
| void | nonRenegablyAckChunk (SctpDataVariables *chunk, SctpPathVariables *sackPath, simtime_t &rttEstimation, Sctp::AssocStat *assocStat) |
| |
| void | handleChunkReportedAsAcked (uint32_t &highestNewAck, simtime_t &rttEstimation, SctpDataVariables *myChunk, SctpPathVariables *sackPath, const bool sackIsNonRevokable) |
| |
| void | handleChunkReportedAsMissing (const SctpSackChunk *sackChunk, const uint32_t highestNewAck, SctpDataVariables *myChunk, SctpPathVariables *sackPath) |
| |
| void | moveChunkToOtherPath (SctpDataVariables *chunk, SctpPathVariables *newPath) |
| |
| void | decreaseOutstandingBytes (SctpDataVariables *chunk) |
| |
| void | increaseOutstandingBytes (SctpDataVariables *chunk, SctpPathVariables *path) |
| |
| int32_t | calculateBytesToSendOnPath (const SctpPathVariables *pathVar) |
| |
| void | storePacket (SctpPathVariables *pathVar, const Ptr< SctpHeader > &sctpMsg, uint16_t chunksAdded, uint16_t dataChunksAdded, bool authAdded) |
| |
| void | loadPacket (SctpPathVariables *pathVar, Ptr< SctpHeader > *sctpMsg, uint16_t *chunksAdded, uint16_t *dataChunksAdded, bool *authAdded) |
| |
| void | ackChunk (SctpDataVariables *chunk, SctpPathVariables *sackPath) |
| |
| void | unackChunk (SctpDataVariables *chunk) |
| |
| bool | chunkHasBeenAcked (const SctpDataVariables *chunk) const |
| |
| bool | chunkHasBeenAcked (uint32_t tsn) const |
| |
| void | checkPseudoCumAck (const SctpPathVariables *path) |
| |
| std::vector< SctpPathVariables * > | getSortedPathMap () |
| |
| void | chunkReschedulingControl (SctpPathVariables *path) |
| |
| void | recalculateOLIABasis () |
| |
| uint32_t | updateOLIA (uint32_t w, uint32_t s, uint32_t totalW, double a, uint32_t mtu, uint32_t ackedBytes, SctpPathVariables *path) |
| | w: cwnd of the path s: ssthresh of the path totalW: Sum of all cwnds of the association a: factor alpha of olia calculation - see https://tools.ietf.org/html/draft-khalili-mptcp-congestion-control-05 mtu: mtu of the path ackedBytes: ackednowlged bytes path: path variable (for further investigation, debug, etc) More...
|
| |
| bool | addAuthChunkIfNecessary (Ptr< SctpHeader > sctpMsg, uint16_t chunkType, bool authAdded) |
| |
| static bool | pathMapLargestSSThreshold (const SctpPathVariables *left, const SctpPathVariables *right) |
| |
| static bool | pathMapLargestSpace (const SctpPathVariables *left, const SctpPathVariables *right) |
| |
| static bool | pathMapLargestSpaceAndSSThreshold (const SctpPathVariables *left, const SctpPathVariables *right) |
| |
| static bool | pathMapSmallestLastTransmission (const SctpPathVariables *left, const SctpPathVariables *right) |
| |
| static bool | pathMapRandomized (const SctpPathVariables *left, const SctpPathVariables *right) |
| |
◆ CounterMap
◆ SctpPathCollection
◆ SctpPathMap
◆ SctpReceiveStreamMap
◆ SctpSendStreamMap
◆ SctpAssociation()
Constructor.
611 EV_INFO <<
"SctpAssociationBase::SctpAssociation(): new assocId="
616 snprintf(fsmName,
sizeof(fsmName),
"fsm-%d",
assocId);
618 fsm->setName(fsmName);
622 SctpPathInfo *pinfo =
new SctpPathInfo(
"pathInfo");
623 pinfo->setRemoteAddress(L3Address());
627 snprintf(timerName,
sizeof(timerName),
"T1_INIT of Association %d",
assocId);
629 snprintf(timerName,
sizeof(timerName),
"T2_SHUTDOWN of Association %d",
assocId);
631 snprintf(timerName,
sizeof(timerName),
"T5_SHUTDOWN_GUARD of Association %d",
assocId);
633 snprintf(timerName,
sizeof(timerName),
"SACK_TIMER of Association %d",
assocId);
655 char vectorName[128];
656 snprintf(vectorName,
sizeof(vectorName),
"Advertised Receiver Window %d",
assocId);
657 advRwnd =
new cOutVector(vectorName);
659 snprintf(vectorName,
sizeof(vectorName),
"Slow Start Threshold %d:Total",
assocId);
661 snprintf(vectorName,
sizeof(vectorName),
"Congestion Window %d:Total",
assocId);
663 snprintf(vectorName,
sizeof(vectorName),
"Bandwidth %d:Total",
assocId);
665 snprintf(vectorName,
sizeof(vectorName),
"Queued Received Bytes %d:Total",
assocId);
667 snprintf(vectorName,
sizeof(vectorName),
"Queued Sent Bytes %d:Total",
assocId);
669 snprintf(vectorName,
sizeof(vectorName),
"Outstanding Bytes %d:Total",
assocId);
672 snprintf(vectorName,
sizeof(vectorName),
"Number of Revokable Gap Blocks in SACK %d",
assocId);
674 snprintf(vectorName,
sizeof(vectorName),
"Number of Non-Revokable Gap Blocks in SACK %d",
assocId);
677 snprintf(vectorName,
sizeof(vectorName),
"Number of Total Gap Blocks Stored %d",
assocId);
679 snprintf(vectorName,
sizeof(vectorName),
"Number of Revokable Gap Blocks Stored %d",
assocId);
681 snprintf(vectorName,
sizeof(vectorName),
"Number of Non-Revokable Gap Blocks Stored %d",
assocId);
683 snprintf(vectorName,
sizeof(vectorName),
"Number of Duplicate TSNs Stored %d",
assocId);
686 snprintf(vectorName,
sizeof(vectorName),
"Number of Revokable Gap Blocks Sent %d",
assocId);
688 snprintf(vectorName,
sizeof(vectorName),
"Number of Non-Revokable Gap Blocks Sent %d",
assocId);
690 snprintf(vectorName,
sizeof(vectorName),
"Number of Duplicate TSNs Sent %d",
assocId);
692 snprintf(vectorName,
sizeof(vectorName),
"Length of SACK Sent %d",
assocId);
695 snprintf(vectorName,
sizeof(vectorName),
"Arwnd in Last SACK %d",
assocId);
697 snprintf(vectorName,
sizeof(vectorName),
"Peer Rwnd %d",
assocId);
710 snprintf(vectorName,
sizeof(vectorName),
"Advertised Message Receiver Window of Association %d",
assocId);
712 snprintf(vectorName,
sizeof(vectorName),
"End to End Delay of Association %d",
assocId);
716 snprintf(vectorName,
sizeof(vectorName),
"Throughput of Association %d",
assocId);
733 EV_DETAIL <<
"Setting Stream Scheduler: ROUND_ROBIN" << endl;
742 EV_DETAIL <<
"Setting Stream Scheduler: ROUND_ROBIN_PACKET" << endl;
751 EV_DETAIL <<
"Setting Stream Scheduler: RANDOM_SCHEDULE" << endl;
760 EV_DETAIL <<
"Setting Stream Scheduler: RANDOM_SCHEDULE_PACKET" << endl;
769 EV_DETAIL <<
"Setting Stream Scheduler: FAIR_BANDWITH" << endl;
778 EV_DETAIL <<
"Setting Stream Scheduler: FAIR_BANDWITH_PACKET" << endl;
787 EV_DETAIL <<
"Setting Stream Scheduler: PRIORITY" << endl;
794 EV_DETAIL <<
"Setting Stream Scheduler: FCFS" << endl;
803 EV_DETAIL <<
"Setting Stream Scheduler: PATH_MANUAL" << endl;
812 EV_DETAIL <<
"Setting Stream Scheduler: PATH_MAP_TO_PATH" << endl;
Referenced by cloneAssociation().
◆ ~SctpAssociation()
| inet::sctp::SctpAssociation::~SctpAssociation |
( |
| ) |
|
Destructor.
819 EV_TRACE <<
"Destructor SctpAssociation " <<
assocId << endl;
◆ ackChunk()
◆ addAuthChunkIfNecessary()
| bool inet::sctp::SctpAssociation::addAuthChunkIfNecessary |
( |
Ptr< SctpHeader > |
sctpMsg, |
|
|
uint16_t |
chunkType, |
|
|
bool |
authAdded |
|
) |
| |
|
inlineprivate |
1489 sctpMsg->appendSctpChunks(authChunk);
1491 it->second.numAuthChunksSent++;
Referenced by sendOnPath().
◆ addInStreams()
| void inet::sctp::SctpAssociation::addInStreams |
( |
uint32_t |
inStreams | ) |
|
|
protected |
◆ addOutStreams()
| void inet::sctp::SctpAssociation::addOutStreams |
( |
uint32_t |
outStreams | ) |
|
|
protected |
99 if ((state->ssLastDataChunkSizeSet == false || state->ssNextStream == false) &&
100 (sendStreams.find(state->lastStreamScheduled)->second->getUnorderedStreamQ()->getLength() > 0 ||
101 sendStreams.find(state->lastStreamScheduled)->second->getStreamQ()->getLength() > 0))
103 sid = state->lastStreamScheduled;
Referenced by SctpAssociation(), and sendAddInAndOutStreamsRequest().
◆ addPath()
| void inet::sctp::SctpAssociation::addPath |
( |
const L3Address & |
addr | ) |
|
|
protected |
2115 EV_INFO <<
"Add Path remote address: " << addr <<
"\n";
2118 EV_DEBUG <<
" get new path for " << addr <<
" at line " << __LINE__ <<
"\n";
2125 EV_INFO <<
"path added\n";
Referenced by processAsconfArrived(), and processInitAckArrived().
◆ advancePeerTsn()
| void inet::sctp::SctpAssociation::advancePeerTsn |
( |
| ) |
|
|
protected |
◆ allPathsInactive()
| bool inet::sctp::SctpAssociation::allPathsInactive |
( |
| ) |
const |
|
protected |
◆ bytesAllowedToSend()
| void inet::sctp::SctpAssociation::bytesAllowedToSend |
( |
SctpPathVariables * |
path, |
|
|
bool |
firstPass |
|
) |
| |
|
protected |
550 assert(path !=
nullptr);
556 EV_INFO <<
"bytesAllowedToSend(" << path->remoteAddress <<
"):"
557 <<
" osb=" << path->outstandingBytes <<
" cwnd=" << path->cwnd << endl;
566 EV_DETAIL <<
"bytesAllowedToSend(" << path->remoteAddress <<
"): zeroWindowProbing" << endl;
573 EV_DETAIL <<
"bytesAllowedToSend(" << path->remoteAddress <<
"): bytes in transQ=" << it->second << endl;
574 if (it->second > 0) {
575 const int32_t allowance = path->cwnd - path->outstandingBytes;
576 EV_DETAIL <<
"bytesAllowedToSend(" << path->remoteAddress <<
"): cwnd-osb=" << allowance << endl;
580 EV_DETAIL <<
"bytesAllowedToSend(" << path->remoteAddress <<
"): one chunk" << endl;
585 else if (allowance > 0) {
587 if (bit->second > (uint32_t)allowance) {
589 EV_DETAIL <<
"bytesAllowedToSend(" << path->remoteAddress <<
"): cwnd does not allow all RTX" << endl;
594 EV_DETAIL <<
"bytesAllowedToSend(" << path->remoteAddress <<
"): cwnd allows more than those "
600 EV_DETAIL <<
"bytesAllowedToSend(" << path->remoteAddress <<
"): allowance<=0: retransmit one packet" << endl;
609 uint32_t myCwnd = path->cwnd;
613 myCwnd = path->tempCwnd;
617 (path->outstandingBytes < myCwnd) &&
622 (path->outstandingBytes < myCwnd) &&
625 ((path->blockingTimeout < 0.0) ||
626 (simTime() >= path->blockingTimeout)))
628 EV_DETAIL <<
"bytesAllowedToSend(" << path->remoteAddress <<
"):"
631 const int32_t allowance = myCwnd - path->outstandingBytes -
bytes.
bytesToSend;
635 EV_DETAIL <<
"bytesAllowedToSend(" << path->remoteAddress <<
"): bytesToSend are limited by cwnd: "
640 EV_DETAIL <<
"bytesAllowedToSend(" << path->remoteAddress <<
"): send all stored bytes: "
650 EV_INFO <<
"bytesAllowedToSend(" << path->remoteAddress <<
"):"
651 <<
" osb=" << path->outstandingBytes
652 <<
" cwnd=" << path->cwnd
653 <<
" tempCwnd=" << path->tempCwnd
654 <<
" bytes.packet=" << (
bytes.
packet ?
"YES!" :
"no")
655 <<
" bytes.chunk=" << (
bytes.
chunk ?
"YES!" :
"no")
Referenced by sendOnPath().
◆ calculateAssocSharedKey()
| void inet::sctp::SctpAssociation::calculateAssocSharedKey |
( |
| ) |
|
|
protected |
263 if (peerFirst ==
true) {
◆ calculateBytesToSendOnPath()
| int32_t inet::sctp::SctpAssociation::calculateBytesToSendOnPath |
( |
const SctpPathVariables * |
pathVar | ) |
|
|
private |
◆ calculateRcvBuffer()
| void inet::sctp::SctpAssociation::calculateRcvBuffer |
( |
| ) |
|
|
protected |
49 uint32_t sumDelivery = 0;
50 uint32_t sumOrdered = 0;
51 uint32_t sumUnOrdered = 0;
52 for (SctpReceiveStreamMap::const_iterator iterator =
receiveStreams.begin();
55 const SctpReceiveStream *stream = iterator->second;
56 sumDelivery += stream->getDeliveryQ()->getQueueSize();
57 sumOrdered += stream->getOrderedQ()->getQueueSize();
58 sumUnOrdered += stream->getUnorderedQ()->getQueueSize();
60 EV_DEBUG <<
"DeliveryQ= " << sumDelivery
61 <<
", OrderedQ=" << sumOrdered
62 <<
", UnorderedQ=" << sumUnOrdered
Referenced by createSack(), makeRoomForTsn(), makeVarFromMsg(), processDataArrived(), and processForwardTsnArrived().
◆ cancelEvent()
| cMessage* inet::sctp::SctpAssociation::cancelEvent |
( |
cMessage * |
msg | ) |
|
|
inlineprotected |
◆ checkOutstandingBytes()
| void inet::sctp::SctpAssociation::checkOutstandingBytes |
( |
| ) |
|
|
private |
◆ checkPseudoCumAck()
| void inet::sctp::SctpAssociation::checkPseudoCumAck |
( |
const SctpPathVariables * |
path | ) |
|
|
private |
113 uint32_t earliestOutstandingTsn = path->pseudoCumAck;
114 uint32_t rtxEarliestOutstandingTsn = path->rtxPseudoCumAck;
118 earliestOutstandingTsn, rtxEarliestOutstandingTsn);
120 if (
tsnGt(path->pseudoCumAck, earliestOutstandingTsn) ||
121 tsnGt(path->rtxPseudoCumAck, rtxEarliestOutstandingTsn))
123 EV_WARN <<
"WRONG PSEUDO CUM-ACK!" << endl
124 <<
"pseudoCumAck=" << path->pseudoCumAck <<
", earliestOutstandingTsn=" << earliestOutstandingTsn << endl
125 <<
"rtxPseudoCumAck=" << path->rtxPseudoCumAck <<
", rtxEarliestOutstandingTsn=" << rtxEarliestOutstandingTsn << endl;
◆ checkStreamsToReset()
| void inet::sctp::SctpAssociation::checkStreamsToReset |
( |
| ) |
|
|
protected |
58 std::list<uint16_t>::iterator it;
79 SctpSsnTsnResetRequestParameter *ssnParam = check_and_cast<SctpSsnTsnResetRequestParameter *>(
state->
incomingRequest);
90 SctpIncomingSsnResetRequestParameter *inParam = check_and_cast<SctpIncomingSsnResetRequestParameter *>(
state->
incomingRequest->
dup());
Referenced by process_RCV_Message().
◆ choosePathForRetransmission()
◆ chunkHasBeenAcked() [1/2]
| bool inet::sctp::SctpAssociation::chunkHasBeenAcked |
( |
const SctpDataVariables * |
chunk | ) |
const |
|
inlineprivate |
◆ chunkHasBeenAcked() [2/2]
| bool inet::sctp::SctpAssociation::chunkHasBeenAcked |
( |
uint32_t |
tsn | ) |
const |
|
inlineprivate |
◆ chunkMustBeAbandoned()
2345 switch (chunk->prMethod) {
2347 if (chunk->expiryTime > 0 && chunk->expiryTime <= simTime()) {
2348 if (!chunk->hasBeenAbandoned) {
2349 EV_INFO <<
"TSN " << chunk->tsn <<
" will be abandoned"
2350 <<
" (expiryTime=" << chunk->expiryTime
2351 <<
" sendTime=" << chunk->sendTime <<
")" << endl;
2352 chunk->hasBeenAbandoned =
true;
2353 chunk->sendForwardIfAbandoned =
true;
2360 if (chunk->numberOfRetransmissions >= chunk->allowedNoRetransmissions) {
2361 if (!chunk->hasBeenAbandoned) {
2362 EV_INFO <<
"chunkMustBeAbandoned: TSN " << chunk->tsn <<
" will be abandoned"
2363 <<
" (maxRetransmissions=" << chunk->allowedNoRetransmissions <<
")" << endl;
2364 chunk->hasBeenAbandoned =
true;
2365 chunk->sendForwardIfAbandoned =
true;
2367 chunk->countsAsOutstanding =
false;
2374 if (chunk->hasBeenAbandoned) {
Referenced by handleChunkReportedAsMissing(), and process_TIMEOUT_RTX().
◆ chunkReschedulingControl()
| void inet::sctp::SctpAssociation::chunkReschedulingControl |
( |
SctpPathVariables * |
path | ) |
|
|
private |
332 EV << simTime() <<
": chunkReschedulingControl:"
337 double totalBandwidth = 0.0;
338 unsigned int totalOutstandingBytes = 0;
339 unsigned int totalQueuedBytes = 0;
342 totalQueuedBytes += myPath->queuedBytes;
343 totalOutstandingBytes += myPath->outstandingBytes;
344 totalBandwidth += (double)myPath->cwnd / myPath->srtt.dbl();
348 const unsigned int queuedBytes = path->queuedBytes;
349 const unsigned int outstandingBytes = path->outstandingBytes;
367 receiverLimit = receiverLimit /
sctpPathMap.size();
370 const double senderBlockingFraction = (queuedBytes - outstandingBytes) / (
double)senderLimit;
371 const double receiverBlockingFraction = (queuedBytes - outstandingBytes) / (
double)receiverLimit;
373 EV <<
" - " << path->remoteAddress
374 <<
"\tt3=" << (path->T3_RtxTimer->isScheduled() ? path->T3_RtxTimer->getArrivalTime().dbl() : -1.0)
375 <<
"\tssthresh=" << path->ssthresh
376 <<
"\tcwnd=" << path->cwnd
377 <<
"\tsrtt=" << path->srtt
378 <<
"\tbw=" << (8.0 * (double)path->cwnd) / (1000000.0 * path->srtt) <<
" Mbit/s"
379 <<
"\tosb=" << path->outstandingBytes
380 <<
"\tqueued=" << path->queuedBytes
381 <<
"\tslimit=" << senderLimit
382 <<
"\trlimit=" << receiverLimit
383 <<
"\tsblocking=" << 100.0 * senderBlockingFraction <<
" %"
384 <<
"\trblocking=" << 100.0 * receiverBlockingFraction <<
" %"
387 path->statisticsPathSenderBlockingFraction->record(senderBlockingFraction);
388 path->statisticsPathReceiverBlockingFraction->record(receiverBlockingFraction);
402 if ((!path->fastRecoveryActive) &&
403 ((path->blockingTimeout < 0.0) ||
404 (simTime() >= path->blockingTimeout)))
409 SctpDataVariables *chunk = iterator->second;
412 if ((chunk->countsAsOutstanding ==
true) &&
413 (chunk->hasBeenMoved ==
false) &&
414 ((lastPath != path) ||
415 (chunk->sendTime + (2 * path->srtt) < simTime())))
417 assert(chunk->numberOfTransmissions > 0);
418 assert(chunk->hasBeenAcked ==
false);
420 EV << simTime() <<
": RESCHEDULING TSN " << chunk->tsn <<
" on "
421 << lastPath->remoteAddress <<
" to "
422 << path->remoteAddress << endl;
425 lastPath->vectorPathBlockingTsnsMoved->record(chunk->tsn);
433 chunk->hasBeenMoved = (lastPath != path);
436 if (lastPath->T3_RtxTimer->isScheduled()) {
439 if (lastPath->queuedBytes == 0) {
446 if (lastPath != path) {
447 if ((lastPath->blockingTimeout >= 0.0) &&
448 (simTime() < lastPath->blockingTimeout))
451 EV << simTime() <<
"\tCR-3 on path "
452 << lastPath->remoteAddress <<
" (blocked until "
453 << lastPath->blockingTimeout <<
")" << endl;
455 else if (lastPath->fastRecoveryActive) {
457 const simtime_t pause = lastPath->srtt;
458 lastPath->blockingTimeout = simTime() + pause;
459 assert(!lastPath->BlockingTimer->isScheduled());
461 EV << simTime() <<
"\tCR-2 on path "
462 << lastPath->remoteAddress <<
" (pause="
463 << pause <<
"; blocked until "
464 << lastPath->blockingTimeout <<
")" << endl;
468 lastPath->requiresRtx =
true;
471 lastPath->requiresRtx =
false;
472 EV << simTime() <<
"\tCR-1 on path "
473 << lastPath->remoteAddress << endl;
477 EV << simTime() <<
"\tCR-4 on path "
478 << path->remoteAddress <<
" (lastTX="
479 << simTime() - chunk->sendTime
480 <<
", TSN " << chunk->tsn <<
")" << endl;
482 lastPath->requiresRtx =
true;
485 lastPath->requiresRtx =
false;
Referenced by sendOnPath().
◆ chunkToInt()
| uint16_t inet::sctp::SctpAssociation::chunkToInt |
( |
const char * |
type | ) |
|
|
static |
241 if (strcmp(
type,
"DATA") == 0)
243 if (strcmp(
type,
"INIT") == 0)
245 if (strcmp(
type,
"INIT_ACK") == 0)
247 if (strcmp(
type,
"SACK") == 0)
249 if (strcmp(
type,
"HEARTBEAT") == 0)
251 if (strcmp(
type,
"HEARTBEAT_ACK") == 0)
253 if (strcmp(
type,
"ABORT") == 0)
255 if (strcmp(
type,
"SHUTDOWN") == 0)
257 if (strcmp(
type,
"SHUTDOWN_ACK") == 0)
259 if (strcmp(
type,
"ERRORTYPE") == 0)
261 if (strcmp(
type,
"COOKIE_ECHO") == 0)
263 if (strcmp(
type,
"COOKIE_ACK") == 0)
265 if (strcmp(
type,
"SHUTDOWN_COMPLETE") == 0)
267 if (strcmp(
type,
"AUTH") == 0)
269 if (strcmp(
type,
"NR-SACK") == 0)
271 if (strcmp(
type,
"ASCONF_ACK") == 0)
273 if (strcmp(
type,
"PKTDROP") == 0)
275 if (strcmp(
type,
"RE_CONFIG") == 0)
277 if (strcmp(
type,
"FORWARD_TSN") == 0)
279 if (strcmp(
type,
"ASCONF") == 0)
281 if (strcmp(
type,
"IFORWARD_TSN") == 0)
283 EV_WARN <<
"ChunkConversion not successful\n";
Referenced by cloneAssociation(), and initAssociation().
◆ cloneAssociation()
Utility: clone a listening association.
Used for forking.
311 const char *sctpAlgorithmClass =
sctpAlgorithm->getClassName();
313 assoc->sctpAlgorithm->setAssociation(assoc);
314 assoc->sctpAlgorithm->initialize();
315 assoc->state = assoc->sctpAlgorithm->createStateVariables();
317 if (
sctpMain->par(
"auth").boolValue()) {
318 const char *chunks =
sctpMain->par(
"chunks");
321 char *chunkscopy = (
char *)malloc(strlen(chunks) + 1);
322 strcpy(chunkscopy, chunks);
324 token = strtok(chunkscopy,
",");
325 while (token !=
nullptr) {
333 token = strtok(
nullptr,
",");
335 if (
sctpMain->par(
"addIP").boolValue()) {
344 assoc->state->active =
false;
345 assoc->state->fork =
true;
349 assoc->listening =
true;
Referenced by processInitArrived().
◆ compareRandom()
| bool inet::sctp::SctpAssociation::compareRandom |
( |
| ) |
|
|
protected |
228 int32_t i, sizeKeyVector, sizePeerKeyVector, size = 0;
233 if (sizeKeyVector != sizePeerKeyVector) {
234 if (sizePeerKeyVector > sizeKeyVector) {
235 size = sizeKeyVector;
236 for (i = sizePeerKeyVector - 1; i > sizeKeyVector; i--) {
242 size = sizePeerKeyVector;
243 for (i = sizeKeyVector - 1; i > sizePeerKeyVector; i--) {
250 size = sizeKeyVector;
251 for (i = size - 1; i > 0; i--) {
Referenced by calculateAssocSharedKey().
◆ createAsconfAckChunk()
| SctpAsconfAckChunk * inet::sctp::SctpAssociation::createAsconfAckChunk |
( |
uint32_t |
serialNumber | ) |
|
|
protected |
203 SctpAsconfAckChunk *asconfAckChunk =
new SctpAsconfAckChunk();
205 asconfAckChunk->setSerialNumber(serialNumber);
207 return asconfAckChunk;
Referenced by processAsconfArrived().
◆ createAuthChunk()
212 SctpAuthenticationChunk *authChunk =
new SctpAuthenticationChunk();
214 authChunk->setSctpChunkType(
AUTH);
215 authChunk->setSharedKey(0);
216 authChunk->setHMacIdentifier(1);
217 authChunk->setHMacOk(
true);
220 authChunk->setHMAC(i, 0);
Referenced by processAsconfArrived(), processPacketDropArrived(), retransmitAsconf(), retransmitCookieEcho(), sendAbort(), sendAsconf(), sendAsconfAck(), sendCookieAck(), sendCookieEcho(), sendHeartbeat(), sendHeartbeatAck(), sendInvalidStreamError(), sendSack(), and sendShutdown().
◆ createForwardTsnChunk()
1352 SctpDataVariables *chunk;
1353 typedef std::map<uint16_t, int16_t> SidMap;
1356 EV_INFO <<
"Create forwardTsnChunk for " << pid <<
"\n";
1357 SctpForwardTsnChunk *forwChunk =
new SctpForwardTsnChunk();
1362 chunk = elem.second;
1363 EV_DETAIL <<
"tsn=" << chunk->tsn <<
" lastDestination=" << chunk->getLastDestination() <<
" abandoned=" << chunk->hasBeenAbandoned <<
"\n";
1364 if (chunk->getLastDestination() == pid && chunk->hasBeenAbandoned && chunk->tsn <= forwChunk->getNewCumTsn()) {
1365 if (chunk->ordered) {
1366 sidMap[chunk->sid] = chunk->ssn;
1369 sidMap[chunk->sid] = -1;
1372 if (chunk->sendForwardIfAbandoned) {
1373 chunk->gapReports = 0;
1374 chunk->hasBeenFastRetransmitted =
false;
1375 chunk->sendTime = simTime();
1376 chunk->numberOfRetransmissions++;
1377 chunk->sendForwardIfAbandoned =
false;
1382 chunk->enqueuedInTransmissionQ =
false;
1386 ib->second -= chunk->booksize;
1391 forwChunk->setSidArraySize(sidMap.size());
1392 forwChunk->setSsnArraySize(sidMap.size());
1394 for (
auto& elem : sidMap) {
1395 forwChunk->setSid(i, elem.first);
1396 forwChunk->setSsn(i, elem.second);
1400 forwChunk->setByteLength(chunkLength);
1402 iter->second.numForwardTsn++;
Referenced by processPacketDropArrived(), and sendOnPath().
◆ createSack()
1539 EV_INFO << simTime() <<
"SctpAssociationUtil:createSACK localAddress=" <<
localAddr <<
" remoteAddress=" <<
remoteAddr <<
"\n";
1545 uint32_t msgRwnd = 0;
1586 EV_DETAIL <<
"arwnd=1; createSack : SWS Avoidance ACTIVE !!!\n";
1603 SctpSackChunk *sackChunk =
new SctpSackChunk();
1605 sackChunk->setSctpChunkType(
NR_SACK);
1609 sackChunk->setSctpChunkType(
SACK);
1612 EV_DEBUG <<
"SACK: set cumTsnAck to " << sackChunk->getCumTsnAck() << endl;
1613 sackChunk->setA_rwnd(arwnd);
1620 sackChunk->setMsg_rwnd(0);
1632 throw cRuntimeError(
"Unknown address type");
1634 const uint32_t allowedLength = mtu
1641 size_t revokableGapsSpace = ~0;
1642 size_t nonRevokableGapsSpace = ~0;
1643 size_t sackHeaderLength = ~0;
1645 bool compression =
false;
1654 const int optR = (int)numRevokableGaps - (
int)totalGaps;
1655 const int optNR = (int)numNonRevokableGaps - (
int)totalGaps;
1658 ((numRevokableGaps > 0) || (numNonRevokableGaps > 0)))
1668 assert(totalGaps < numRevokableGaps);
1672 assert(numRevokableGaps == totalGaps);
1679 assert(totalGaps < numNonRevokableGaps);
1680 sackChunk->setNrSubtractRGaps(
true);
1684 assert(numNonRevokableGaps == totalGaps);
1691 if (compression ==
true) {
1701 numNonRevokableGaps = 0;
1702 nonRevokableGapsSpace = 0;
1707 uint32_t sackLength = sackHeaderLength + revokableGapsSpace + nonRevokableGapsSpace + numDups * 4;
1708 if (sackLength > allowedLength) {
1716 sackLength -= 4 * numDups;
1718 if (sackLength > allowedLength) {
1723 iter->second.numOverfullSACKs++;
1725 if (sackChunk->getNrSubtractRGaps() ==
true) {
1726 sackChunk->setNrSubtractRGaps(
false);
1730 revokableGapsSpace = allowedLength - sackHeaderLength;
1737 sackLength = sackHeaderLength + revokableGapsSpace + nonRevokableGapsSpace + numDups * 4;
1741 if (sackHeaderLength + revokableGapsSpace < allowedLength) {
1743 nonRevokableGapsSpace = allowedLength - sackHeaderLength - revokableGapsSpace;
1745 sackLength = sackHeaderLength + revokableGapsSpace + nonRevokableGapsSpace + numDups * 4;
1749 nonRevokableGapsSpace = allowedLength - sackHeaderLength;
1754 if (sackLength > allowedLength) {
1755 double revokableFraction = 1.0;
1756 const uint32_t blocksBeRemoved = (sackLength - allowedLength) / 4;
1757 if (numRevokableGaps + numNonRevokableGaps > 0) {
1758 revokableFraction = numRevokableGaps / (double)(numRevokableGaps + numNonRevokableGaps);
1760 const uint32_t removeRevokable = (uint32_t)ceil(blocksBeRemoved * revokableFraction);
1761 const uint32_t removeNonRevokable = (uint32_t)ceil(blocksBeRemoved * (1.0 - revokableFraction));
1762 numRevokableGaps -=
std::min(removeRevokable, numRevokableGaps);
1763 numNonRevokableGaps -=
std::min(removeNonRevokable, numNonRevokableGaps);
1764 revokableGapsSpace = 4 * numRevokableGaps;
1765 nonRevokableGapsSpace = 4 * numNonRevokableGaps;
1768 sackLength = sackHeaderLength + revokableGapsSpace + nonRevokableGapsSpace + numDups * 4;
1772 assert(sackLength <= allowedLength);
1775 sackChunk->setNumGaps(numRevokableGaps);
1776 sackChunk->setNumNrGaps(numNonRevokableGaps);
1779 sackChunk->setNumDupTsns(numDups);
1780 sackChunk->setByteLength(sackLength);
1788 sackChunk->setNumGaps(numRevokableGaps);
1789 sackChunk->setNumNrGaps(numNonRevokableGaps);
1790 sackLength = sackHeaderLength + revokableGapsSpace + nonRevokableGapsSpace + numDups * 4;
1799 sackChunk->setDupTsnsArraySize(numDups);
1802 sackChunk->setDupTsns(key, elem);
1817 EV_DEBUG <<
"createSack:"
1819 <<
" msgRwnd=" << msgRwnd
1820 <<
" arwnd=" << sackChunk->getA_rwnd()
1822 <<
" numRGaps=" << numRevokableGaps
1823 <<
" numNRGaps=" << numNonRevokableGaps
1824 <<
" numDups=" << numDups
Referenced by sendInvalidStreamError(), sendOnPath(), sendSack(), and sendStreamResetResponse().
◆ createSuccessIndication()
299 SctpSuccessIndication *success =
new SctpSuccessIndication();
302 success->setResponseCorrelationId(correlationId);
Referenced by processAsconfArrived().
◆ cucProcessGapReports()
944 if ((path->findPseudoCumAck ==
true) &&
945 ((chunk->numberOfRetransmissions == 0) ||
948 path->pseudoCumAck = chunk->tsn;
949 path->findPseudoCumAck =
false;
952 (path->pseudoCumAck == chunk->tsn))
954 path->newPseudoCumAck =
true;
955 path->findPseudoCumAck =
true;
959 if ((path->findRTXPseudoCumAck ==
true) &&
960 (chunk->numberOfRetransmissions > 0))
962 path->rtxPseudoCumAck = chunk->tsn;
963 path->findRTXPseudoCumAck =
false;
966 (path->rtxPseudoCumAck == chunk->tsn))
968 path->newRTXPseudoCumAck =
true;
969 path->findRTXPseudoCumAck =
true;
Referenced by processSackArrived().
◆ cwndUpdateAfterCwndTimeout()
| void inet::sctp::SctpAssociation::cwndUpdateAfterCwndTimeout |
( |
SctpPathVariables * |
path | ) |
|
|
protected |
982 EV_INFO <<
assocId <<
": " << simTime() <<
":\tCC [cwndUpdateAfterCwndTimeout]\t" << path->remoteAddress
983 <<
" (cmtCCGroup=" << path->cmtCCGroup <<
")"
984 <<
"\tsst=" << path->ssthresh
985 <<
"\tcwnd=" << path->cwnd;
987 EV_INFO <<
"\t=>\tsst=" << path->ssthresh
988 <<
"\tcwnd=" << path->cwnd << endl;
Referenced by stateEntered().
◆ cwndUpdateAfterRtxTimeout()
| void inet::sctp::SctpAssociation::cwndUpdateAfterRtxTimeout |
( |
SctpPathVariables * |
path | ) |
|
|
protected |
832 double decreaseFactor = 0.5;
833 path->oliaSentBytes = 0;
834 EV <<
assocId <<
": " << simTime() <<
":\tCC [cwndUpdateAfterRtxTimeout]\t" << path->remoteAddress
835 <<
" (cmtCCGroup=" << path->cmtCCGroup <<
")"
836 <<
"\tsst=" << path->ssthresh
837 <<
"\tcwnd=" << path->cwnd
838 <<
"\tSST=" << path->cmtGroupTotalSsthresh
839 <<
"\tCWND=" << path->cmtGroupTotalCwnd
840 <<
"\tBW.CWND=" << path->cmtGroupTotalCwndBandwidth;
842 decreaseFactor = HighSpeedCwndAdjustmentTable[path->highSpeedCCThresholdIdx].
decreaseFactor;
843 EV <<
"\tHighSpeedDecreaseFactor=" << decreaseFactor;
848 path->ssthresh =
max((int32_t)path->cwnd - (int32_t)rint(decreaseFactor * (
double)path->cwnd),
849 4 * (int32_t)path->pmtu);
850 path->cwnd = path->pmtu;
856 const double sstRatio = (double)path->ssthresh / (
double)path->cmtGroupTotalSsthresh;
857 const int32_t decreasedWindow = (int32_t)path->cwnd - (int32_t)rint(path->cmtGroupTotalCwnd * decreaseFactor);
858 path->ssthresh =
max(decreasedWindow,
859 max((int32_t)path->pmtu,
860 (int32_t)ceil((
double)
state->
rpMinCwnd * (
double)path->pmtu * sstRatio)));
861 path->cwnd =
max((int32_t)path->pmtu,
862 (int32_t)ceil((
double)path->pmtu * sstRatio));
866 const double pathBandwidth = path->cwnd / GET_SRTT(path->srtt.dbl());
867 const double bandwidthToGive = path->cmtGroupTotalCwndBandwidth / 2.0;
868 const double reductionFactor =
max(0.5, bandwidthToGive / pathBandwidth);
871 (int32_t)ceil(path->cwnd - reductionFactor * path->cwnd));
872 path->cwnd = path->pmtu;
876 path->ssthresh =
max((int32_t)path->cwnd - (int32_t)rint(decreaseFactor * (
double)path->cwnd),
878 path->cwnd = path->pmtu;
882 path->ssthresh =
max((int32_t)path->cwnd - (int32_t)rint(decreaseFactor * (
double)path->cwnd),
883 4 * (int32_t)path->pmtu);
884 path->cwnd = path->pmtu;
888 const double pathBandwidth = path->cwnd / GET_SRTT(path->srtt.dbl());
889 const double bandwidthToGive = path->cmtGroupTotalCwndBandwidth / 2.0;
890 const double reductionFactor =
max(0.5, bandwidthToGive / pathBandwidth);
893 (int32_t)ceil(path->cwnd - reductionFactor * path->cwnd));
894 path->cwnd = path->pmtu;
898 path->ssthresh =
max((int32_t)path->cwnd - (int32_t)rint(decreaseFactor * (
double)path->cwnd),
900 path->cwnd = path->pmtu;
904 throw cRuntimeError(
"Implementation for this cmtCCVariant is missing!");
907 path->highSpeedCCThresholdIdx = 0;
908 path->partialBytesAcked = 0;
909 path->vectorPathPbAcked->record(path->partialBytesAcked);
910 EV_INFO <<
"\t=>\tsst=" << path->ssthresh
911 <<
"\tcwnd=" << path->cwnd << endl;
915 if (path->fastRecoveryActive ==
true) {
916 path->fastRecoveryActive =
false;
917 path->fastRecoveryExitPoint = 0;
918 path->vectorPathFastRecoveryState->record(0);
Referenced by stateEntered().
◆ cwndUpdateAfterSack()
| void inet::sctp::SctpAssociation::cwndUpdateAfterSack |
( |
| ) |
|
|
protected |
437 if (path->fastRecoveryActive ==
false) {
439 if (path->requiresRtx) {
440 double decreaseFactor = 0.5;
441 EV <<
assocId <<
": " << simTime() <<
":\tCC [cwndUpdateAfterSack]\t" << path->remoteAddress
442 <<
" (cmtCCGroup=" << path->cmtCCGroup <<
")"
443 <<
"\tsst=" << path->ssthresh
444 <<
"\tcwnd=" << path->cwnd
445 <<
"\tSST=" << path->cmtGroupTotalSsthresh
446 <<
"\tCWND=" << path->cmtGroupTotalCwnd
447 <<
"\tBW.CWND=" << path->cmtGroupTotalCwndBandwidth;
449 decreaseFactor = HighSpeedCwndAdjustmentTable[path->highSpeedCCThresholdIdx].
decreaseFactor;
450 EV <<
"\tHighSpeedDecreaseFactor=" << decreaseFactor;
457 EV_INFO << simTime() <<
":\tCC [cwndUpdateAfterSack]\t" << path->remoteAddress
458 <<
"\tsst=" << path->ssthresh <<
" cwnd=" << path->cwnd;
460 path->ssthresh =
max((int32_t)path->cwnd - (int32_t)rint(decreaseFactor * (
double)path->cwnd),
461 4 * (int32_t)path->pmtu);
462 path->cwnd = path->ssthresh;
468 const double sstRatio = (double)path->ssthresh / (
double)path->cmtGroupTotalSsthresh;
469 const int32_t reducedCwnd =
rpPathBlockingControl(path, rint(path->cmtGroupTotalCwnd * decreaseFactor));
470 path->ssthresh =
max(reducedCwnd,
471 max((int32_t)path->pmtu,
472 (int32_t)ceil((
double)
state->
rpMinCwnd * (
double)path->pmtu * sstRatio)));
473 path->cwnd = path->ssthresh;
478 const double pathBandwidth = path->cwnd / GET_SRTT(path->srtt.dbl());
479 const double bandwidthToGive = path->cmtGroupTotalCwndBandwidth / 2.0;
480 const double reductionFactor =
max(0.5, bandwidthToGive / pathBandwidth);
482 path->ssthresh = (int32_t)
max(reducedCwnd, (int32_t)
state->
rpMinCwnd * (int32_t)path->pmtu);
483 path->cwnd = path->ssthresh;
489 path->ssthresh =
max(reducedCwnd, (int32_t)
state->
rpMinCwnd * (int32_t)path->pmtu);
490 path->cwnd = path->ssthresh;
494 path->ssthresh =
max((int32_t)path->cwnd - (int32_t)rint(decreaseFactor * (
double)path->cwnd),
495 4 * (int32_t)path->pmtu);
496 path->cwnd = path->ssthresh;
501 const double pathBandwidth = path->cwnd / GET_SRTT(path->srtt.dbl());
502 const double bandwidthToGive = path->cmtGroupTotalCwndBandwidth / 2.0;
503 const double reductionFactor =
max(0.5, bandwidthToGive / pathBandwidth);
505 path->ssthresh = (int32_t)
max(reducedCwnd, (int32_t)
state->
rpMinCwnd * (int32_t)path->pmtu);
506 path->cwnd = path->ssthresh;
512 path->ssthresh =
max(reducedCwnd, (int32_t)
state->
rpMinCwnd * (int32_t)path->pmtu);
513 path->cwnd = path->ssthresh;
517 throw cRuntimeError(
"Implementation for this cmtCCVariant is missing!");
521 EV_INFO <<
"\t=>\tsst=" << path->ssthresh <<
" cwnd=" << path->cwnd << endl;
523 path->partialBytesAcked = 0;
524 path->vectorPathPbAcked->record(path->partialBytesAcked);
536 const SctpDataVariables *chunk = chunkIterator->second;
537 if (chunk->getLastDestinationPath() == path) {
539 if (
tsnGt(chunk->tsn, highestAckOnPath)) {
540 highestAckOnPath = chunk->tsn;
544 if (
tsnGt(chunk->tsn, highestOutstanding)) {
545 highestOutstanding = chunk->tsn;
550 path->oliaSentBytes = 0;
552 path->fastRecoveryActive =
true;
553 path->fastRecoveryExitPoint = highestOutstanding;
554 path->fastRecoveryEnteringTime = simTime();
555 path->vectorPathFastRecoveryState->record(path->cwnd);
557 EV_INFO << simTime() <<
":\tCC [cwndUpdateAfterSack] Entering Fast Recovery on path "
558 << path->remoteAddress
559 <<
", exit point is " << path->fastRecoveryExitPoint
560 <<
", pseudoCumAck=" << path->pseudoCumAck
561 <<
", rtxPseudoCumAck=" << path->rtxPseudoCumAck << endl;
568 if (path->fastRecoveryActive) {
569 EV_INFO <<
assocId <<
": " << simTime() <<
":\tCC [cwndUpdateAfterSack] Still in Fast Recovery on path "
570 << path->remoteAddress
571 <<
", exit point is " << path->fastRecoveryExitPoint << endl;
Referenced by stateEntered().
◆ cwndUpdateBeforeSack()
| void inet::sctp::SctpAssociation::cwndUpdateBeforeSack |
( |
| ) |
|
|
protected |
138 otherPath->utilizedCwnd = otherPath->outstandingBytesBeforeUpdate;
142 for (
auto currentPathIterator =
sctpPathMap.begin();
143 currentPathIterator !=
sctpPathMap.end(); currentPathIterator++)
147 currentPath->cmtGroupPaths = 0;
148 currentPath->cmtGroupTotalCwnd = 0;
149 currentPath->cmtGroupTotalSsthresh = 0;
150 currentPath->cmtGroupTotalUtilizedCwnd = 0;
151 currentPath->cmtGroupTotalCwndBandwidth = 0.0;
152 currentPath->cmtGroupTotalUtilizedCwndBandwidth = 0.0;
154 double qNumerator = 0.0;
155 double qDenominator = 0.0;
156 for (SctpPathMap::const_iterator otherPathIterator =
sctpPathMap.begin();
157 otherPathIterator !=
sctpPathMap.end(); otherPathIterator++)
160 if (otherPath->cmtCCGroup == currentPath->cmtCCGroup) {
161 currentPath->cmtGroupPaths++;
163 currentPath->cmtGroupTotalCwnd += otherPath->cwnd;
164 currentPath->cmtGroupTotalSsthresh += otherPath->ssthresh;
165 currentPath->cmtGroupTotalCwndBandwidth += otherPath->cwnd / GET_SRTT(otherPath->srtt.dbl());
167 if ((otherPath->blockingTimeout < 0.0) || (otherPath->blockingTimeout < simTime())) {
168 currentPath->cmtGroupTotalUtilizedCwnd += otherPath->utilizedCwnd;
169 currentPath->cmtGroupTotalUtilizedCwndBandwidth += otherPath->utilizedCwnd / GET_SRTT(otherPath->srtt.dbl());
172 qNumerator =
max(qNumerator, otherPath->cwnd / (pow(GET_SRTT(otherPath->srtt.dbl()), 2.0)));
173 qDenominator = qDenominator + (otherPath->cwnd / GET_SRTT(otherPath->srtt.dbl()));
176 currentPath->cmtGroupAlpha = currentPath->cmtGroupTotalCwnd * (qNumerator / pow(qDenominator, 2.0));
Referenced by stateEntered().
◆ cwndUpdateBytesAcked()
| void inet::sctp::SctpAssociation::cwndUpdateBytesAcked |
( |
SctpPathVariables * |
path, |
|
|
uint32_t |
ackedBytes, |
|
|
bool |
ctsnaAdvanced |
|
) |
| |
|
protected |
609 EV_INFO << simTime() <<
"====> cwndUpdateBytesAcked:"
610 <<
" path=" << path->remoteAddress
611 <<
" ackedBytes=" << ackedBytes
612 <<
" ctsnaAdvanced=" << ((ctsnaAdvanced ==
true) ?
"yes" :
"no")
613 <<
" cwnd=" << path->cwnd
614 <<
" ssthresh=" << path->ssthresh
615 <<
" ackedBytes=" << ackedBytes
616 <<
" pathOsbBeforeUpdate=" << path->outstandingBytesBeforeUpdate
617 <<
" pathOsb=" << path->outstandingBytes
620 if (path->fastRecoveryActive ==
false) {
625 if (path->cwnd <= path->ssthresh) {
627 path->partialBytesAcked = 0;
630 if ((ctsnaAdvanced ==
true) &&
631 ((path->outstandingBytesBeforeUpdate >= path->cwnd) ||
634 EV_INFO <<
assocId <<
": " << simTime() <<
":\tCC [cwndUpdateBytesAcked-SlowStart]\t" << path->remoteAddress
635 <<
" (cmtCCGroup=" << path->cmtCCGroup <<
")"
636 <<
"\tacked=" << ackedBytes
637 <<
"\tsst=" << path->ssthresh
638 <<
"\tcwnd=" << path->cwnd
639 <<
"\tSST=" << path->cmtGroupTotalSsthresh
640 <<
"\tCWND=" << path->cmtGroupTotalCwnd
641 <<
"\tBW.CWND=" << path->cmtGroupTotalCwndBandwidth;
645 path->cwnd += (int32_t)
min(path->pmtu, ackedBytes);
651 const double sstRatio = (double)path->ssthresh / (
double)path->cmtGroupTotalSsthresh;
652 path->cwnd += (int32_t)ceil(
min(path->pmtu, ackedBytes) * sstRatio);
657 const double increaseRatio = ((double)path->cwnd / GET_SRTT(path->srtt.dbl()))
658 / (double)path->cmtGroupTotalCwndBandwidth;
659 path->cwnd += (int32_t)ceil(
min(path->pmtu, ackedBytes) * increaseRatio);
664 path->cwnd = updateMPTCP(path->cwnd, path->cmtGroupTotalCwnd,
665 path->cmtGroupAlpha, path->pmtu, ackedBytes);
669 path->cwnd =
updateOLIA(path->cwnd, path->ssthresh,
670 path->cmtGroupTotalCwnd, path->cmtGroupAlpha,
671 path->pmtu, ackedBytes, path);
676 const double increaseRatio = ((double)path->utilizedCwnd / GET_SRTT(path->srtt.dbl()))
677 / (double)path->cmtGroupTotalUtilizedCwndBandwidth;
678 path->cwnd += (int32_t)ceil(
min(path->pmtu, ackedBytes) * increaseRatio);
682 path->cwnd = updateMPTCP(path->cwnd, path->cmtGroupTotalCwnd,
683 path->cmtGroupAlpha, path->pmtu, ackedBytes);
687 throw cRuntimeError(
"Implementation for this cmtCCVariant is missing!");
690 path->vectorPathPbAcked->record(path->partialBytesAcked);
691 EV <<
"\t=>\tsst=" << path->ssthresh
692 <<
"\tcwnd=" << path->cwnd << endl;
698 EV_INFO <<
assocId <<
": " << simTime() <<
":\tCC "
699 <<
"Not increasing cwnd of path " << path->remoteAddress <<
" in slow start:\t"
700 <<
"ctsnaAdvanced=" << ((ctsnaAdvanced ==
true) ?
"yes" :
"no") <<
"\t"
701 <<
"cwnd=" << path->cwnd <<
"\t"
702 <<
"ssthresh=" << path->ssthresh <<
"\t"
703 <<
"ackedBytes=" << ackedBytes <<
"\t"
704 <<
"pathOsbBeforeUpdate=" << path->outstandingBytesBeforeUpdate <<
"\t"
705 <<
"pathOsb=" << path->outstandingBytes <<
"\t"
706 <<
"(pathOsbBeforeUpdate >= path->cwnd)="
707 << (path->outstandingBytesBeforeUpdate >= path->cwnd) << endl;
713 path->partialBytesAcked += ackedBytes;
716 double increaseFactor = 1.0;
719 increaseFactor = HighSpeedCwndAdjustmentTable[path->highSpeedCCThresholdIdx].
increaseFactor;
720 EV <<
"HighSpeedCC Increase: factor=" << increaseFactor << endl;
723 const bool avancedAndEnoughOutstanding =
724 (ctsnaAdvanced ==
true) &&
725 ((path->outstandingBytesBeforeUpdate >= path->cwnd) ||
727 (path->outstandingBytesBeforeUpdate + path->pmtu > path->cwnd)));
728 const bool enoughPartiallyAcked =
729 (path->partialBytesAcked >= path->cwnd) ||
731 (path->partialBytesAcked >= path->pmtu) &&
732 (path->partialBytesAcked + path->pmtu > path->cwnd));
734 if (avancedAndEnoughOutstanding && enoughPartiallyAcked) {
735 EV <<
assocId <<
": " << simTime() <<
":\tCC [cwndUpdateBytesAcked-CgAvoidance]\t" << path->remoteAddress
736 <<
" (cmtCCGroup=" << path->cmtCCGroup <<
")"
737 <<
"\tacked=" << ackedBytes
738 <<
"\tsst=" << path->ssthresh
739 <<
"\tcwnd=" << path->cwnd
740 <<
"\tSST=" << path->cmtGroupTotalSsthresh
741 <<
"\tCWND=" << path->cmtGroupTotalCwnd
742 <<
"\tBW.CWND=" << path->cmtGroupTotalCwndBandwidth;
746 path->cwnd += (int32_t)rint(increaseFactor * path->pmtu);
752 const double sstRatio = (double)path->ssthresh / (
double)path->cmtGroupTotalSsthresh;
753 path->cwnd += (int32_t)ceil(increaseFactor * path->pmtu * sstRatio);
758 const double increaseRatio = ((double)path->cwnd / GET_SRTT(path->srtt.dbl()))
759 / (double)path->cmtGroupTotalCwndBandwidth;
760 path->cwnd += (int32_t)ceil(increaseFactor * path->pmtu * increaseRatio);
765 path->cwnd = updateMPTCP(path->cwnd, path->cmtGroupTotalCwnd,
766 path->cmtGroupAlpha, path->pmtu, path->pmtu);
770 path->cwnd =
updateOLIA(path->cwnd, path->ssthresh,
771 path->cmtGroupTotalCwnd, path->cmtGroupAlpha,
772 path->pmtu, path->pmtu, path);
777 const double increaseRatio = ((double)path->utilizedCwnd / GET_SRTT(path->srtt.dbl()))
778 / (double)path->cmtGroupTotalUtilizedCwndBandwidth;
779 path->cwnd += (int32_t)ceil(increaseFactor * path->pmtu * increaseRatio);
783 path->cwnd = updateMPTCP(path->cwnd, path->cmtGroupTotalCwnd,
784 path->cmtGroupAlpha, path->pmtu, path->pmtu);
788 throw cRuntimeError(
"Implementation for this cmtCCVariant is missing!");
791 EV <<
"\t=>\tsst=" << path->ssthresh
792 <<
"\tcwnd=" << path->cwnd << endl;
795 path->partialBytesAcked =
796 ((path->cwnd < path->partialBytesAcked) ?
797 (path->partialBytesAcked - path->cwnd) : 0);
801 EV_INFO <<
assocId <<
": " << simTime() <<
":\tCC "
802 <<
"Not increasing cwnd of path " << path->remoteAddress <<
" in congestion avoidance: "
803 <<
"ctsnaAdvanced=" << ((ctsnaAdvanced ==
true) ?
"yes" :
"no") <<
"\t"
804 <<
"cwnd=" << path->cwnd <<
"\t"
805 <<
"ssthresh=" << path->ssthresh <<
"\t"
806 <<
"ackedBytes=" << ackedBytes <<
"\t"
807 <<
"pathOsbBeforeUpdate=" << path->outstandingBytesBeforeUpdate <<
"\t"
808 <<
"pathOsb=" << path->outstandingBytes <<
"\t"
809 <<
"(pathOsbBeforeUpdate >= path->cwnd)="
810 << (path->outstandingBytesBeforeUpdate >= path->cwnd) <<
"\t"
811 <<
"partialBytesAcked=" << path->partialBytesAcked <<
"\t"
812 <<
"(path->partialBytesAcked >= path->cwnd)="
813 << (path->partialBytesAcked >= path->cwnd) << endl;
818 if (path->outstandingBytes == 0) {
819 path->partialBytesAcked = 0;
821 path->vectorPathPbAcked->record(path->partialBytesAcked);
824 EV_INFO <<
assocId <<
": " << simTime() <<
":\tCC "
825 <<
"Not increasing cwnd of path " << path->remoteAddress
826 <<
" during Fast Recovery" << endl;
Referenced by stateEntered().
◆ cwndUpdateMaxBurst()
929 if (path->cwnd > ((path->outstandingBytes +
state->
maxBurst * path->pmtu))) {
930 EV_INFO <<
assocId <<
": " << simTime() <<
":\tCC [cwndUpdateMaxBurst]\t"
931 << path->remoteAddress
932 <<
"\tsst=" << path->ssthresh
933 <<
"\tcwnd=" << path->cwnd
934 <<
"\ttempCwnd=" << path->tempCwnd
935 <<
"\tosb=" << path->outstandingBytes
942 path->cwnd = path->outstandingBytes + (
state->
maxBurst * path->pmtu);
947 path->tempCwnd = path->outstandingBytes + (
state->
maxBurst * path->pmtu);
954 if (path->ssthresh < path->cwnd) {
955 path->ssthresh = path->cwnd;
959 if (path->ssthresh < path->tempCwnd) {
960 path->ssthresh = path->tempCwnd;
965 EV_INFO <<
"\t=>\tsst=" << path->ssthresh
966 <<
"\tcwnd=" << path->cwnd
967 <<
"\ttempCwnd=" << path->tempCwnd
973 path->tempCwnd = path->cwnd;
Referenced by stateEntered().
◆ decreaseOutstandingBytes()
| void inet::sctp::SctpAssociation::decreaseOutstandingBytes |
( |
SctpDataVariables * |
chunk | ) |
|
|
private |
◆ deleteStreams()
| void inet::sctp::SctpAssociation::deleteStreams |
( |
| ) |
|
◆ dequeueAckedChunks()
| void inet::sctp::SctpAssociation::dequeueAckedChunks |
( |
const uint32_t |
tsna, |
|
|
SctpPathVariables * |
path, |
|
|
simtime_t & |
rttEstimation |
|
) |
| |
|
protected |
2035 rttEstimation = SIMTIME_MAX;
2040 SctpDataVariables *chunk = iterator->second;
2041 if (
tsnGe(tsna, chunk->tsn)) {
2042 EV_DETAIL << simTime() <<
": CumAcked TSN " << chunk->tsn
2043 <<
" on path " << chunk->getLastDestination() << endl;
2048 lastPath->newCumAck =
true;
2050 lastPath->findPseudoCumAck =
true;
2051 lastPath->newPseudoCumAck =
true;
2053 lastPath->findRTXPseudoCumAck =
true;
2054 lastPath->newRTXPseudoCumAck =
true;
2065 EV_INFO <<
"dequeueAckedChunks(): rttEstimation=" << rttEstimation << endl;
Referenced by process_RCV_Message(), and processSackArrived().
◆ dequeueOutboundDataMsg()
| SctpDataMsg * inet::sctp::SctpAssociation::dequeueOutboundDataMsg |
( |
SctpPathVariables * |
path, |
|
|
int32_t |
availableSpace, |
|
|
int32_t |
availableCwnd |
|
) |
| |
|
protected |
2561 SctpDataMsg *datMsg =
nullptr;
2562 cPacketQueue *streamQ =
nullptr;
2563 int32_t nextStream = -1;
2565 EV_INFO <<
"dequeueOutboundDataMsg: " << availableSpace <<
" bytes left to be sent" << endl;
2575 if (nextStream == -1)
2578 EV_INFO <<
"dequeueOutboundDataMsg: now stream " << nextStream << endl;
2580 SctpSendStream *stream =
sendStreams.find(nextStream)->second;
2583 if (!stream->getUnorderedStreamQ()->isEmpty()) {
2584 streamQ = stream->getUnorderedStreamQ();
2585 EV_DETAIL <<
"DequeueOutboundDataMsg() found chunks in stream " << nextStream <<
" unordered queue, queue size=" << stream->getUnorderedStreamQ()->getLength() <<
"\n";
2587 else if (!stream->getStreamQ()->isEmpty()) {
2588 streamQ = stream->getStreamQ();
2589 EV_DETAIL <<
"DequeueOutboundDataMsg() found chunks in stream " << nextStream <<
" ordered queue, queue size=" << stream->getStreamQ()->getLength() <<
"\n";
2595 if ((
b <= availableSpace) &&
2596 ((int32_t)check_and_cast<SctpDataMsg *>(streamQ->front())->getBooksize() <= availableCwnd))
2598 datMsg = check_and_cast<SctpDataMsg *>(streamQ->pop());
2599 sendQueue->record(streamQ->getLength());
2601 if (!datMsg->getFragment()) {
2602 datMsg->setBBit(
true);
2603 datMsg->setEBit(
true);
2607 if (datMsg->getEBit())
2613 EV_DETAIL <<
"DequeueOutboundDataMsg() found chunk (" << datMsg->str() <<
") in the stream queue " << nextStream <<
"(" << streamQ <<
") queue size=" << streamQ->getLength() << endl;
2617 if (datMsg !=
nullptr) {
Referenced by sendOnPath().
◆ disposeOf()
| void inet::sctp::SctpAssociation::disposeOf |
( |
SctpHeader * |
sctpmsg | ) |
|
|
protected |
2883 uint32_t numberOfChunks = sctpmsg->getSctpChunksArraySize();
2884 if (numberOfChunks > 0)
2885 for (uint32_t i = 0; i < numberOfChunks; i++) {
2886 chunk = sctpmsg->removeFirstChunk();
Referenced by processPacketDropArrived(), and sendPacketDrop().
◆ eventName()
| const char * inet::sctp::SctpAssociation::eventName |
( |
int32_t |
event | ) |
|
|
staticprotected |
◆ fragmentOutboundDataMsgs()
| void inet::sctp::SctpAssociation::fragmentOutboundDataMsgs |
( |
| ) |
|
|
protected |
2429 cPacketQueue *streamQ =
nullptr;
2431 SctpSendStream *stream = iter->second;
2434 if (!stream->getUnorderedStreamQ()->isEmpty()) {
2435 streamQ = stream->getUnorderedStreamQ();
2436 EV_DETAIL <<
"fragmentOutboundDataMsgs() found chunks in stream " << iter->first <<
" unordered queue, queue size=" << stream->getUnorderedStreamQ()->getLength() <<
"\n";
2438 else if (!stream->getStreamQ()->isEmpty()) {
2439 streamQ = stream->getStreamQ();
2440 EV_DETAIL <<
"fragmentOutboundDataMsgs() found chunks in stream " << iter->first <<
" ordered queue, queue size=" << stream->getStreamQ()->getLength() <<
"\n";
2449 SctpDataMsg *datMsgQueued = check_and_cast<SctpDataMsg *>(streamQ->pop());
2450 cPacket *datMsgQueuedEncMsg = datMsgQueued->getEncapsulatedPacket();
2451 SctpDataMsg *datMsgLastFragment =
nullptr;
2452 uint32_t offset = 0;
2454 const uint16_t fullSizedPackets = (uint16_t)(datMsgQueued->getByteLength() / msgbytes);
2455 EV_DETAIL <<
"Fragmentation: chunk " << &datMsgQueued <<
" - size = " << datMsgQueued->getByteLength() << endl;
2456 EV_DETAIL <<
assocId <<
": number of fullSizedPackets: " << fullSizedPackets << endl;
2457 uint16_t pcounter = 0;
2459 while (datMsgQueued) {
2461 if (msgbytes > datMsgQueuedEncMsg->getByteLength() - offset)
2462 msgbytes = datMsgQueuedEncMsg->getByteLength() - offset;
2465 SctpDataMsg *datMsgFragment =
new SctpDataMsg();
2466 datMsgFragment->setSid(datMsgQueued->getSid());
2467 datMsgFragment->setPpid(datMsgQueued->getPpid());
2469 datMsgFragment->setSackNow(
true);
2471 datMsgFragment->setSackNow(datMsgQueued->getSackNow());
2472 datMsgFragment->setInitialDestination(datMsgQueued->getInitialDestination());
2473 datMsgFragment->setEnqueuingTime(datMsgQueued->getEnqueuingTime());
2474 datMsgFragment->setPrMethod(datMsgQueued->getPrMethod());
2475 datMsgFragment->setPriority(datMsgQueued->getPriority());
2477 datMsgFragment->setStrReset(datMsgQueued->getStrReset());
2478 datMsgFragment->setMsgNum(datMsgQueued->getMsgNum());
2479 datMsgFragment->setOrdered(datMsgQueued->getOrdered());
2480 datMsgFragment->setExpiryTime(datMsgQueued->getExpiryTime());
2481 datMsgFragment->setRtx(datMsgQueued->getRtx());
2482 datMsgFragment->setFragment(
true);
2487 datMsgFragment->setBooksize(msgbytes +
state->
header);
2491 datMsgFragment->setBBit(
true);
2494 cPacket *datMsgFragmentEncMsg = datMsgQueuedEncMsg->dup();
2496 datMsgFragmentEncMsg->setByteLength(msgbytes);
2498 SctpSimpleMessage *datMsgQueuedSimple =
dynamic_cast<SctpSimpleMessage *
>(datMsgQueuedEncMsg);
2499 SctpSimpleMessage *datMsgFragmentSimple =
dynamic_cast<SctpSimpleMessage *
>(datMsgFragmentEncMsg);
2500 if ((datMsgQueuedSimple !=
nullptr) &&
2501 (datMsgFragmentSimple !=
nullptr) &&
2502 (datMsgQueuedSimple->getDataArraySize() >= msgbytes + offset))
2504 datMsgFragmentSimple->setDataArraySize(msgbytes);
2505 datMsgFragmentSimple->setDataLen(msgbytes);
2507 for (uint32_t i = offset; i < offset + msgbytes; i++) {
2508 datMsgFragmentSimple->setData(i - offset, datMsgQueuedSimple->getData(i));
2514 datMsgFragment->encapsulate(datMsgFragmentEncMsg);
2517 if (!streamQ->isEmpty()) {
2518 if (!datMsgLastFragment) {
2520 streamQ->insertBefore(check_and_cast<SctpDataMsg *>(streamQ->front()), datMsgFragment);
2524 streamQ->insertAfter(datMsgLastFragment, datMsgFragment);
2528 streamQ->insert(datMsgFragment);
2533 EV_DETAIL <<
"Fragmentation: fragment " << &datMsgFragment <<
" created, length = " << datMsgFragmentEncMsg->getByteLength() <<
", queue size = " << streamQ->getLength() << endl;
2535 datMsgLastFragment = datMsgFragment;
2538 if (datMsgQueuedEncMsg->getByteLength() == offset) {
2539 datMsgFragment->setEBit(
true);
2541 datMsgFragment->setSackNow(
true);
2543 EV_DETAIL <<
"Fragmentation: delete " << &datMsgQueued << endl;
2547 delete datMsgQueued;
2548 datMsgQueued =
nullptr;
Referenced by dequeueOutboundDataMsg().
◆ generateSendQueueAbatedIndication()
| void inet::sctp::SctpAssociation::generateSendQueueAbatedIndication |
( |
uint64_t |
bytes | ) |
|
|
private |
1998 EV_INFO << simTime() <<
":\tSCTP_I_SENDQUEUE_ABATED("
1999 <<
bytes <<
") to refill buffer "
2004 msg->addTag<SocketInd>()->setSocketId(
assocId);
2005 auto& sendQueueAbatedIndication = msg->addTag<SctpSendQueueAbatedReq>();
2006 sendQueueAbatedIndication->setSocketId(
assocId);
2007 sendQueueAbatedIndication->setLocalAddr(
localAddr);
2008 sendQueueAbatedIndication->setRemoteAddr(
remoteAddr);
2009 sendQueueAbatedIndication->setNumMsgs(
bytes);
2010 sendQueueAbatedIndication->setQueuedForStreamArraySize(
sendStreams.size());
2011 unsigned int streamID = 0;
2013 const SctpSendStream *stream = elem.second;
2014 sendQueueAbatedIndication->setQueuedForStream(streamID, stream->getUnorderedStreamQ()->getByteLength() + stream->getStreamQ()->getByteLength());
Referenced by processSackArrived().
◆ getAddressLevel()
| int inet::sctp::SctpAssociation::getAddressLevel |
( |
const L3Address & |
addr | ) |
|
|
static |
◆ getAllTransQ()
| uint32_t inet::sctp::SctpAssociation::getAllTransQ |
( |
| ) |
|
|
protected |
◆ getBytesInFlightOfStream()
| uint32_t inet::sctp::SctpAssociation::getBytesInFlightOfStream |
( |
uint16_t |
sid | ) |
|
|
protected |
◆ getExpectedSsnOfStream()
| uint32_t inet::sctp::SctpAssociation::getExpectedSsnOfStream |
( |
uint16_t |
id | ) |
|
|
protected |
◆ getFragInProgressOfStream()
| bool inet::sctp::SctpAssociation::getFragInProgressOfStream |
( |
uint16_t |
sid | ) |
|
|
protected |
◆ getFsm()
| cFSM* inet::sctp::SctpAssociation::getFsm |
( |
| ) |
const |
|
inline |
◆ getFsmState()
| int32_t inet::sctp::SctpAssociation::getFsmState |
( |
| ) |
const |
|
inline |
1008 {
return fsm->getState(); };
◆ getInitialCwnd()
| uint32_t inet::sctp::SctpAssociation::getInitialCwnd |
( |
const SctpPathVariables * |
path | ) |
const |
|
private |
◆ getInitTimer()
| cMessage* inet::sctp::SctpAssociation::getInitTimer |
( |
| ) |
const |
|
inline |
◆ getNextAddress()
1223 if (nextPath !=
nullptr) {
1224 return nextPath->remoteAddress;
Referenced by sendAsconf().
◆ getNextDestination()
2700 EV_DEBUG <<
"Running getNextDestination()" << endl;
2701 if (chunk->numberOfTransmissions == 0) {
2702 if (chunk->getInitialDestinationPath() ==
nullptr) {
2706 next = chunk->getInitialDestinationPath();
2710 if (chunk->hasBeenFastRetransmitted) {
2711 EV_DETAIL <<
"Chunk " << chunk->tsn <<
" is scheduled for FastRetransmission. Next destination = "
2712 << chunk->getLastDestination() << endl;
2713 return chunk->getLastDestinationPath();
2718 if ((next ==
nullptr) || (next->confirmed ==
false)) {
2723 EV_INFO <<
"getNextDestination(): chunk was last sent to " << chunk->getLastDestination()
2724 <<
", will next be sent to path " << next->remoteAddress << endl;
Referenced by handleChunkReportedAsMissing(), and process_TIMEOUT_RTX().
◆ getNextPath()
◆ getOutboundDataChunk()
2306 EV_INFO <<
"getOutboundDataChunk(" << path->remoteAddress <<
"):"
2307 <<
" availableSpace=" << availableSpace
2308 <<
" availableCwnd=" << availableCwnd
2314 SctpDataVariables *chunk = it->second;
2316 (chunk->getNextDestinationPath() == path))
2319 EV_DETAIL <<
"getOutboundDataChunk() found chunk " << chunk->tsn
2320 <<
" in the transmission queue, length=" << len << endl;
2321 if ((len <= availableSpace) &&
2322 ((int32_t)chunk->booksize <= availableCwnd))
2329 chunk->enqueuedInTransmissionQ =
false;
2333 ib->second -= chunk->booksize;
2339 EV_INFO <<
"no chunk found in transmissionQ\n";
Referenced by sendOnPath().
◆ getOutstandingBytes()
| int32_t inet::sctp::SctpAssociation::getOutstandingBytes |
( |
| ) |
const |
|
protected |
◆ getPath()
1049 SctpPathMap::const_iterator iterator =
sctpPathMap.find(pathId);
1050 return (iterator !=
sctpPathMap.end()) ? iterator->second :
nullptr;
Referenced by createSack(), process_PRIMARY(), process_RCV_Message(), process_SEND(), process_STATUS(), process_STREAM_RESET(), processAddInAndOutResetRequestArrived(), processAsconfAckArrived(), processAsconfArrived(), processDataArrived(), processHeartbeatAckArrived(), processInitAckArrived(), processInitArrived(), processOutAndResponseArrived(), processOutgoingResetRequestArrived(), processPacketDropArrived(), processResetResponseArrived(), processSackArrived(), processTimer(), sendAddInAndOutStreamsRequest(), sendAddOutgoingStreamsRequest(), sendAsconf(), sendBundledOutgoingResetAndResponse(), sendDoubleStreamResetResponse(), sendInit(), sendInitAck(), sendOutgoingRequestAndResponse(), sendOutgoingResetRequest(), sendPacketDrop(), sendShutdownAck(), sendStreamResetRequest(), sendStreamResetResponse(), and sendToIP().
◆ getRetransmissionQueue()
| SctpQueue* inet::sctp::SctpAssociation::getRetransmissionQueue |
( |
| ) |
const |
|
inline |
◆ getSackTimer()
| cMessage* inet::sctp::SctpAssociation::getSackTimer |
( |
| ) |
const |
|
inline |
◆ getSctpAlgorithm()
| SctpAlgorithm* inet::sctp::SctpAssociation::getSctpAlgorithm |
( |
| ) |
const |
|
inline |
◆ getSctpMain()
| Sctp* inet::sctp::SctpAssociation::getSctpMain |
( |
| ) |
const |
|
inline |
◆ getShutdownTimer()
| cMessage* inet::sctp::SctpAssociation::getShutdownTimer |
( |
| ) |
const |
|
inline |
◆ getSortedPathMap()
123 std::vector<SctpPathVariables *> sortedPaths;
126 sortedPaths.insert(sortedPaths.end(), path);
132 EV <<
"SORTED PATH MAP:" << endl;
133 for (
auto path : sortedPaths) {
134 EV <<
" - " << path->remoteAddress
135 <<
" cwnd=" << path->cwnd
136 <<
" ssthresh=" << path->ssthresh
137 <<
" outstanding=" << path->outstandingBytes
Referenced by sendOnAllPaths().
◆ getSsnOfStream()
| uint32_t inet::sctp::SctpAssociation::getSsnOfStream |
( |
uint16_t |
id | ) |
|
|
protected |
◆ getState()
◆ getTransmissionQueue()
| SctpQueue* inet::sctp::SctpAssociation::getTransmissionQueue |
( |
| ) |
const |
|
inline |
◆ handleChunkReportedAsAcked()
| void inet::sctp::SctpAssociation::handleChunkReportedAsAcked |
( |
uint32_t & |
highestNewAck, |
|
|
simtime_t & |
rttEstimation, |
|
|
SctpDataVariables * |
myChunk, |
|
|
SctpPathVariables * |
sackPath, |
|
|
const bool |
sackIsNonRevokable |
|
) |
| |
|
private |
1595 EV <<
"TSN " << myChunk->tsn <<
" on path " << myChunkLastPath->remoteAddress <<
":\t"
1596 <<
"findPseudoCumAck=" << ((myChunkLastPath->findPseudoCumAck ==
true) ?
"true" :
"false") <<
"\t"
1597 <<
"pseudoCumAck=" << myChunkLastPath->pseudoCumAck <<
"\t"
1598 <<
"newPseudoCumAck=" << ((myChunkLastPath->newPseudoCumAck ==
true) ?
"true" :
"false") <<
"\t"
1599 <<
"findRTXPseudoCumAck=" << ((myChunkLastPath->findRTXPseudoCumAck ==
true) ?
"true" :
"false") <<
"\t"
1600 <<
"rtxPseudoCumAck=" << myChunkLastPath->rtxPseudoCumAck <<
"\t"
1601 <<
"newRTXPseudoCumAck=" << ((myChunkLastPath->newRTXPseudoCumAck ==
true) ?
"true" :
"false") <<
"\t"
1605 if (myChunkLastPath->sawNewAck ==
false) {
1606 EV <<
"TSN " << myChunk->tsn <<
" on path " << myChunkLastPath->remoteAddress <<
":\t"
1607 <<
"Saw new ack -> setting highestNewAckInSack!" << endl;
1608 myChunkLastPath->sawNewAck =
true;
1614 if ((!myChunk->hasBeenTimerBasedRtxed) ||
1617 if (myChunkLastPath->lowestNewAckInSack == 0) {
1618 myChunkLastPath->lowestNewAckInSack = myChunk->tsn;
1620 if (myChunkLastPath->highestNewAckInSack == 0) {
1621 myChunkLastPath->highestNewAckInSack = myChunk->tsn;
1623 else if (
tsnLt(myChunkLastPath->highestNewAckInSack, myChunk->tsn)) {
1624 myChunkLastPath->highestNewAckInSack = myChunk->tsn;
1628 if ((myChunk->numberOfTransmissions == 1) &&
1629 (myChunk->hasBeenMoved ==
false) &&
1630 (myChunk->hasBeenReneged ==
false))
1632 if (myChunkLastPath == sackPath) {
1633 const simtime_t timeDifference = simTime() - myChunk->sendTime;
1634 if ((timeDifference < rttEstimation) || (rttEstimation == -1.0)) {
1635 rttEstimation = timeDifference;
1637 EV_DETAIL << simTime() <<
" processSackArrived: computed rtt time diff == "
1638 << timeDifference <<
" for TSN " << myChunk->tsn << endl;
1643 (myChunkLastPath->waitingForRTTCalculaton ==
false))
1649 myChunkLastPath->tsnForRTTCalculation = myChunk->tsn;
1650 myChunkLastPath->txTimeForRTTCalculation = myChunk->sendTime;
1651 myChunkLastPath->waitingForRTTCalculaton =
true;
1655 if ((myChunk->hasBeenAbandoned ==
false) &&
1656 (myChunk->hasBeenReneged ==
false) &&
1657 (myChunk->hasBeenAcked ==
false))
1659 EV_DETAIL << simTime() <<
": GapAcked TSN " << myChunk->tsn
1660 <<
" on path " << myChunkLastPath->remoteAddress << endl;
1662 if (myChunk->tsn > highestNewAck) {
1663 highestNewAck = myChunk->tsn;
1666 if (sackIsNonRevokable ==
true) {
1667 myChunkLastPath->gapAckedChunksInLastSACK++;
1668 myChunkLastPath->gapNRAckedChunksInLastSACK++;
1671 myChunkLastPath->gapAckedChunksInLastSACK++;
1676 if (sackIsNonRevokable ==
true) {
Referenced by processSackArrived().
◆ handleChunkReportedAsMissing()
1694 EV_INFO <<
"TSN " << myChunk->tsn <<
" is missing in gap reports (last "
1695 << myChunkLastPath->remoteAddress <<
") ";
1697 EV_DETAIL <<
"has not been acked, highestNewAck=" << highestNewAck
1698 <<
" countsAsOutstanding=" << myChunk->countsAsOutstanding << endl;
1702 uint32_t chunkReportedAsMissing = (highestNewAck > myChunk->tsn || (myChunk->getLastDestinationPath()->fastRecoveryActive &&
state->
highestTsnAcked >= myChunk->tsn)) ? 1 : 0;
1706 chunkReportedAsMissing = 0;
1710 if ((myChunkLastPath->sawNewAck) &&
1711 (
tsnGt(myChunkLastPath->highestNewAckInSack, myChunk->tsn)))
1714 chunkReportedAsMissing = 1;
1719 bool sawNewAckOnlyOnThisPath =
true;
1722 if ((otherPath != myChunkLastPath) && (otherPath->sawNewAck)) {
1723 sawNewAckOnlyOnThisPath =
false;
1727 if (sawNewAckOnlyOnThisPath ==
true) {
1729 EV <<
"SplitFastRTX + DAC: all on same path: "
1730 <<
"TSN=" << myChunk->tsn
1731 <<
" lowestNewAckInSack=" << myChunkLastPath->lowestNewAckInSack
1732 <<
" highestNewAckInSack=" << myChunkLastPath->highestNewAckInSack
1733 <<
" (on path " << myChunkLastPath->remoteAddress <<
")" << endl;
1739 if (
tsnLt(myChunkLastPath->lowestNewAckInSack, myChunk->tsn) &&
1740 tsnLt(myChunk->tsn, myChunkLastPath->highestNewAckInSack))
1742 EV <<
" => conservative increment of 1" << endl;
1743 chunkReportedAsMissing = 1;
1745 else if (
tsnGt(myChunkLastPath->lowestNewAckInSack, myChunk->tsn)) {
1746 EV <<
" => reported increment of dacPacketsRcvd=" << (
unsigned int)sackChunk->getDacPacketsRcvd() << endl;
1747 chunkReportedAsMissing = sackChunk->getDacPacketsRcvd();
1752 EV <<
"SplitFastRTX + DAC: mixed acks, increment is 1" << endl;
1753 chunkReportedAsMissing = 1;
1758 EV <<
"SplitFastRTX: chunkReportedAsMissing="
1759 << chunkReportedAsMissing <<
", "
1760 <<
"sawNewAck=" << myChunkLastPath->sawNewAck <<
", "
1761 <<
"lowestNewAckInSack=" << myChunkLastPath->lowestNewAckInSack
1762 <<
"highestNewAckInSack=" << myChunkLastPath->highestNewAckInSack <<
", "
1763 <<
"TSN=" << myChunk->tsn << endl;
1765 if (chunkReportedAsMissing > 0) {
1766 myChunk->gapReports += chunkReportedAsMissing;
1767 myChunkLastPath->gapUnackedChunksInLastSACK++;
1770 bool fastRtx =
false;
1773 fastRtx = ((myChunk->hasBeenFastRetransmitted ==
false) &&
1774 ((myChunk->numberOfRetransmissions == 0) ||
1775 ((myChunk->hasBeenMoved) &&
1776 (myChunk->countsAsOutstanding) &&
1782 fastRtx = ((myChunk->hasBeenFastRetransmitted ==
false) &&
1783 (myChunk->numberOfRetransmissions == 0 ||
1784 (simTime() - myChunk->sendTime) > myChunkLastPath->srtt));
1796 if (myChunk->hasBeenMoved) {
1797 EV << simTime() <<
": MovedFastRTX for TSN " << myChunk->tsn << endl;
1799 myChunk->hasBeenMoved =
false;
1808 myChunk->hasBeenFastRetransmitted =
true;
1809 myChunk->sendForwardIfAbandoned =
true;
1811 EV_DETAIL << simTime() <<
": Fast RTX for TSN "
1812 << myChunk->tsn <<
" on path " << myChunk->getLastDestination() << endl;
1813 myChunkLastPath->numberOfFastRetransmissions++;
1817 assert(myChunkNextPath !=
nullptr);
1819 if (myChunk->countsAsOutstanding) {
1823 EV_DETAIL <<
"Fast RTX: cannot add message/chunk (TSN="
1824 << myChunk->tsn <<
") to the transmissionQ" << endl;
1827 myChunk->enqueuedInTransmissionQ =
true;
1831 qb->second += myChunk->booksize;
1833 myChunkNextPath->requiresRtx =
true;
1834 if (myChunkNextPath->findLowestTsn ==
true) {
1836 myChunkNextPath->lowestTsnRetransmitted =
true;
1842 myChunkLastPath->findLowestTsn =
false;
Referenced by processSackArrived().
◆ increaseOutstandingBytes()
23 path->outstandingBytes += chunk->booksize;
24 path->statisticsPathOutstandingBytes->record(path->outstandingBytes);
26 SctpSendStream *stream =
nullptr;
29 stream = associter->second;
32 throw cRuntimeError(
"Stream with id %d not found", chunk->sid);
34 stream->setBytesInFlight(stream->getBytesInFlight() + chunk->booksize);
Referenced by loadPacket(), and sendOnPath().
◆ indicationName()
| const char * inet::sctp::SctpAssociation::indicationName |
( |
int32_t |
code | ) |
|
|
static |
◆ initAssociation()
| void inet::sctp::SctpAssociation::initAssociation |
( |
SctpOpenReq * |
openCmd | ) |
|
|
protected |
Utility: creates send/receive queues and sctpAlgorithm.
510 EV_INFO <<
"SctpAssociationUtil:initAssociation\n";
512 const char *queueClass = openCmd->getQueueClass();
519 const char *sctpAlgorithmClass = openCmd->getSctpAlgorithmClass();
520 if (opp_isempty(sctpAlgorithmClass))
521 sctpAlgorithmClass =
sctpMain->par(
"sctpAlgorithmClass");
528 if (
sctpMain->par(
"auth").boolValue()) {
529 const char *chunks =
sctpMain->par(
"chunks");
532 char *chunkscopy = (
char *)malloc(strlen(chunks) + 1);
533 strcpy(chunkscopy, chunks);
535 token = strtok(chunkscopy,
",");
536 while (token !=
nullptr) {
542 token = strtok(
nullptr,
",");
544 if (
sctpMain->par(
"addIP").boolValue()) {
Referenced by process_ASSOCIATE(), and process_OPEN_PASSIVE().
◆ initCcParameters()
SctpCcFunctions.
403 EV_DEBUG << simTime() <<
":\tCC [initCCParameters]\t" << path->remoteAddress
404 <<
" (cmtCCGroup=" << path->cmtCCGroup <<
")"
405 <<
"\tsst=" << path->ssthresh <<
" cwnd=" << path->cwnd << endl;
Referenced by pmStartPathManagement(), and stateEntered().
◆ initStreams()
| void inet::sctp::SctpAssociation::initStreams |
( |
uint32_t |
inStreams, |
|
|
uint32_t |
outStreams |
|
) |
| |
|
protected |
61 SctpReceiveStream *rcvStream =
new SctpReceiveStream(
this);
63 rcvStream->setStreamId(i);
65 snprintf(vectorName,
sizeof(vectorName),
"Stream %d Throughput", i);
73 EV_INFO <<
"Add " << outStreams <<
" outbound streams" << endl;
74 for (i =
sendStreams.size(), j = 0; j < outStreams; i++, j++) {
75 SctpSendStream *sendStream =
new SctpSendStream(
this, i);
76 sendStream->setStreamId(i);
Referenced by SctpAssociation().
◆ isToBeAccepted()
| bool inet::sctp::SctpAssociation::isToBeAccepted |
( |
| ) |
const |
|
inlineprotected |
◆ listOrderedQ()
| void inet::sctp::SctpAssociation::listOrderedQ |
( |
| ) |
|
|
protected |
70 EV_DEBUG <<
"stream " << elem.second->getStreamId() <<
":\n";
71 elem.second->getOrderedQ()->printQueue();
◆ loadPacket()
| void inet::sctp::SctpAssociation::loadPacket |
( |
SctpPathVariables * |
pathVar, |
|
|
Ptr< SctpHeader > * |
sctpMsg, |
|
|
uint16_t * |
chunksAdded, |
|
|
uint16_t * |
dataChunksAdded, |
|
|
bool * |
authAdded |
|
) |
| |
|
private |
94 EV_INFO <<
"loadPacket: path=" << pathVar->remoteAddress <<
" osb=" << pathVar->outstandingBytes <<
" -> " << pathVar->outstandingBytes +
state->
packetBytes << endl;
103 for (uint16_t i = 0; i < (*sctpMsg)->getSctpChunksArraySize(); i++) {
104 const SctpChunk *chunkPtr = (*sctpMsg)->getSctpChunks(i);
105 if (chunkPtr->getSctpChunkType() == 0) {
106 const SctpDataChunk *dataChunk = check_and_cast<const SctpDataChunk *>(chunkPtr);
107 if (dataChunk !=
nullptr) {
108 const uint32_t tsn = dataChunk->getTsn();
110 assert(chunk !=
nullptr);
111 chunk->queuedOnPath = pathVar;
112 chunk->queuedOnPath->queuedBytes += chunk->booksize;
113 chunk->setLastDestination(pathVar);
115 chunk->countsAsOutstanding =
true;
Referenced by sendOnPath().
◆ makeAddStreamsRequestParameter()
378 SctpAddStreamsRequestParameter *addStreams =
new SctpAddStreamsRequestParameter();
379 if (info->getInstreams() > 0) {
381 addStreams->setNumberOfStreams(info->getInstreams());
386 else if (info->getOutstreams() > 0) {
388 addStreams->setNumberOfStreams(info->getOutstreams());
393 addStreams->setSrReqSn(srsn);
Referenced by sendStreamResetRequest().
◆ makeDataVarFromDataMsg()
179 SctpDataVariables *datVar =
new SctpDataVariables();
181 datMsg->setInitialDestination(path->remoteAddress);
182 datVar->setInitialDestination(path);
184 datVar->bbit = datMsg->getBBit();
185 datVar->ebit = datMsg->getEBit();
186 datVar->ibit = datMsg->getSackNow();
187 datVar->enqueuingTime = datMsg->getEnqueuingTime();
188 datVar->expiryTime = datMsg->getExpiryTime();
189 datVar->ppid = datMsg->getPpid();
190 datVar->len = datMsg->getByteLength() * 8;
191 datVar->sid = datMsg->getSid();
192 datVar->allowedNoRetransmissions = datMsg->getRtx();
193 datVar->booksize = datMsg->getBooksize();
194 datVar->prMethod = datMsg->getPrMethod();
195 datVar->priority = datMsg->getPriority();
196 datVar->strReset = datMsg->getStrReset();
199 auto iterator =
sendStreams.find(datMsg->getSid());
200 SctpSendStream *stream = iterator->second;
201 uint32_t nextSSN = stream->getNextStreamSeqNum();
202 datVar->userData = datMsg->decapsulate();
204 if (datMsg->getOrdered()) {
206 if (datMsg->getEBit()) {
207 datVar->ssn = nextSSN++;
210 datVar->ssn = nextSSN;
213 datVar->ordered =
true;
214 if (nextSSN > 65535) {
215 stream->setNextStreamSeqNum(0);
218 stream->setNextStreamSeqNum(nextSSN);
224 datVar->ordered =
false;
Referenced by sendOnPath().
◆ makeIncomingStreamResetParameter()
359 SctpIncomingSsnResetRequestParameter *inResetParam;
360 inResetParam =
new SctpIncomingSsnResetRequestParameter();
362 inResetParam->setSrReqSn(srsn);
363 if (info->getStreamsArraySize() > 0) {
364 inResetParam->setStreamNumbersArraySize(info->getStreamsArraySize());
365 for (
uint i = 0; i < info->getStreamsArraySize(); i++) {
366 inResetParam->setStreamNumbers(i, info->getStreams(i));
367 state->
requests[srsn].streams.push_back(inResetParam->getStreamNumbers(i));
Referenced by sendStreamResetRequest().
◆ makeOutgoingStreamResetParameter()
324 SctpOutgoingSsnResetRequestParameter *outResetParam;
325 outResetParam =
new SctpOutgoingSsnResetRequestParameter();
327 outResetParam->setSrReqSn(srsn);
332 if (info->getStreamsArraySize() > 0) {
333 outResetParam->setStreamNumbersArraySize(info->getStreamsArraySize());
334 for (
uint i = 0; i < info->getStreamsArraySize(); i++) {
335 outResetParam->setStreamNumbers(i, (uint16_t)info->getStreams(i));
337 state->
requests[srsn].streams.push_back(outResetParam->getStreamNumbers(i));
345 outResetParam->setStreamNumbers(i, *it);
347 state->
requests[srsn].streams.push_back(outResetParam->getStreamNumbers(i));
354 return outResetParam;
Referenced by sendStreamResetRequest().
◆ makeRoomForTsn()
| bool inet::sctp::SctpAssociation::makeRoomForTsn |
( |
const uint32_t |
tsn, |
|
|
const uint32_t |
length, |
|
|
const bool |
uBit |
|
) |
| |
|
protected |
2156 EV_INFO << simTime() <<
":\tmakeRoomForTsn:"
2158 <<
" length=" << length
2168 while ((sum < length) &&
2172 if (
tsnGt(tsn, tryTsn)) {
2174 EV_DETAIL <<
"makeRoomForTsn:"
2175 <<
" tsn=" << tryTsn
2176 <<
" tryTsn=" << tryTsn <<
" -> no space" << endl;
2180 const uint32_t oldSum = sum;
2183 SctpReceiveStream *receiveStream = elem.second;
2188 queue = receiveStream->getUnorderedQ();
2191 queue = receiveStream->getOrderedQ();
2193 SctpDataVariables *chunk = queue->getChunk(tryTsn);
2194 if (chunk ==
nullptr) {
2195 EV_DETAIL << tryTsn <<
" not found in orderedQ. Try deliveryQ" << endl;
2197 queue = receiveStream->getDeliveryQ();
2198 chunk = queue->getChunk(tryTsn);
2202 if (chunk !=
nullptr) {
2204 if (queue->deleteMsg(tryTsn)) {
2205 EV_INFO << tryTsn <<
" found and deleted" << endl;
2208 if (
ssnGt(receiveStream->getExpectedStreamSeqNum(), chunk->ssn)) {
2209 receiveStream->setExpectedStreamSeqNum(chunk->ssn);
2213 iter->second.numChunksReneged++;
2221 EV_INFO <<
"TSN " << tryTsn <<
" not found in stream "
2222 << receiveStream->getStreamId() << endl;
2225 if (sum == oldSum) {
2226 EV_INFO << tryTsn <<
" not found in any stream" << endl;
Referenced by processDataArrived().
◆ makeSsnTsnResetParameter()
| SctpParameter * inet::sctp::SctpAssociation::makeSsnTsnResetParameter |
( |
uint32_t |
srsn | ) |
|
|
protected |
400 SctpSsnTsnResetRequestParameter *resetParam;
401 resetParam =
new SctpSsnTsnResetRequestParameter();
403 resetParam->setSrReqSn(srsn);
Referenced by sendStreamResetRequest().
◆ makeVarFromMsg()
2247 SctpDataVariables *chunk =
new SctpDataVariables();
2249 chunk->bbit = dataChunk->getBBit();
2250 chunk->ebit = dataChunk->getEBit();
2251 chunk->ibit = dataChunk->getIBit();
2252 chunk->sid = dataChunk->getSid();
2253 chunk->ssn = dataChunk->getSsn();
2254 chunk->ppid = dataChunk->getPpid();
2255 chunk->tsn = dataChunk->getTsn();
2256 if (!dataChunk->getUBit()) {
2257 chunk->ordered =
true;
2260 chunk->ordered =
false;
2262 SctpSimpleMessage *smsg = check_and_cast<SctpSimpleMessage *>(dataChunk->decapsulate());
2265 chunk->userData = smsg;
2266 EV_INFO <<
"smsg encapsulate? " << smsg->getEncaps() << endl;
2267 if (smsg->getEncaps())
2268 chunk->len = smsg->getByteLength() * 8;
2270 chunk->len = smsg->getDataLen() * 8;
2271 chunk->firstSendTime = dataChunk->getFirstSendTime();
2274 EV_INFO <<
"makeVarFromMsg: queuedBytes has been increased to "
Referenced by processDataArrived().
◆ midGt()
| static bool inet::sctp::SctpAssociation::midGt |
( |
const uint32_t |
mid1, |
|
|
const uint32_t |
mid2 |
|
) |
| |
|
inlinestatic |
◆ moveChunkToOtherPath()
3899 if (chunk->countsAsOutstanding) {
3904 chunk->hasBeenFastRetransmitted =
false;
3905 chunk->gapReports = 0;
3906 chunk->setNextDestination(newPath);
3909 assert(chunk->queuedOnPath->queuedBytes >= chunk->booksize);
3910 chunk->queuedOnPath->queuedBytes -= chunk->booksize;
3911 chunk->queuedOnPath->statisticsPathQueuedSentBytes->record(chunk->queuedOnPath->queuedBytes);
3913 chunk->queuedOnPath = chunk->getNextDestinationPath();
3914 chunk->queuedOnPath->queuedBytes += chunk->booksize;
3915 chunk->queuedOnPath->statisticsPathQueuedSentBytes->record(chunk->queuedOnPath->queuedBytes);
3921 EV_DETAIL <<
"TSN " << chunk->tsn <<
" already in transmissionQ" << endl;
3925 chunk->enqueuedInTransmissionQ =
true;
3926 EV_DETAIL <<
"Inserting TSN " << chunk->tsn <<
" into transmissionQ" << endl;
3930 qb->second += chunk->booksize;
Referenced by chunkReschedulingControl(), and process_TIMEOUT_RTX().
◆ msgMustBeAbandoned()
| bool inet::sctp::SctpAssociation::msgMustBeAbandoned |
( |
SctpDataMsg * |
msg, |
|
|
int32_t |
stream, |
|
|
bool |
ordered |
|
) |
| |
|
protected |
◆ nextChunkFitsIntoPacket()
| bool inet::sctp::SctpAssociation::nextChunkFitsIntoPacket |
( |
SctpPathVariables * |
path, |
|
|
int32_t |
bytes |
|
) |
| |
|
protected |
2626 int32_t nextStream = -1;
2627 SctpSendStream *stream;
2635 if (nextStream == -1)
2641 cPacketQueue *streamQ =
nullptr;
2643 if (!stream->getUnorderedStreamQ()->isEmpty())
2644 streamQ = stream->getUnorderedStreamQ();
2645 else if (!stream->getStreamQ()->isEmpty())
2646 streamQ = stream->getStreamQ();
Referenced by sendOnPath().
◆ nonRenegablyAckChunk()
1857 assert(lastPath !=
nullptr);
1864 auto streamIterator =
sendStreams.find(chunk->sid);
1866 SctpSendStream *stream = streamIterator->second;
1867 assert(stream !=
nullptr);
1868 cPacketQueue *streamQ = (chunk->ordered ==
false) ? stream->getUnorderedStreamQ() : stream->getStreamQ();
1869 assert(streamQ !=
nullptr);
1871 if (chunk->priority > 0) {
1875 if ((chunk->hasBeenCountedAsNewlyAcked ==
false) &&
1876 (chunk->hasBeenAcked ==
false))
1879 (chunk->hasBeenMoved ==
false))
1881 chunk->hasBeenCountedAsNewlyAcked =
true;
1884 lastPath->newlyAckedBytes += chunk->booksize;
1888 assert(chunk->queuedOnPath->queuedBytes >= chunk->booksize);
1889 chunk->queuedOnPath->queuedBytes -= chunk->booksize;
1890 chunk->queuedOnPath->statisticsPathQueuedSentBytes->record(chunk->queuedOnPath->queuedBytes);
1891 chunk->queuedOnPath =
nullptr;
1897 assocStat->ackedBytes += chunk->len / 8;
1900 assocStat->fairAckedBytes += chunk->len / 8;
1905 (lastPath->waitingForRTTCalculaton ==
false) &&
1906 (lastPath != sackPath) &&
1907 (chunk->numberOfTransmissions == 1) &&
1908 (chunk->hasBeenMoved ==
false) &&
1909 (chunk->hasBeenReneged ==
false))
1914 lastPath->tsnForRTTCalculation = chunk->tsn;
1915 lastPath->txTimeForRTTCalculation = chunk->sendTime;
1916 lastPath->waitingForRTTCalculaton =
true;
1921 if ((chunk->numberOfTransmissions == 1) && (lastPath == sackPath) && (chunk->hasBeenMoved ==
false)) {
1922 const simtime_t timeDifference = simTime() - chunk->sendTime;
1923 if ((timeDifference < rttEstimation) || (rttEstimation == SIMTIME_MAX)) {
1924 rttEstimation = timeDifference;
1938 chunk->enqueuedInTransmissionQ =
false;
1942 qb->second -= chunk->booksize;
1947 if (chunk->userData !=
nullptr) {
Referenced by dequeueAckedChunks(), and handleChunkReportedAsAcked().
◆ numUsableStreams()
| int32_t inet::sctp::SctpAssociation::numUsableStreams |
( |
| ) |
|
|
protected |
168 if (
sendStreams.find(testsid)->second->getUnorderedStreamQ()->getLength() > 0 ||
169 sendStreams.find(testsid)->second->getStreamQ()->getLength() > 0)
172 EV_DETAIL <<
"Stream Scheduler: chose sid " << sid <<
".\n";
Referenced by SctpAssociation().
◆ orderedQueueEmptyOfStream()
| bool inet::sctp::SctpAssociation::orderedQueueEmptyOfStream |
( |
uint16_t |
sid | ) |
|
|
protected |
◆ pathMapLargestSpace()
160 const int l = (left->cwnd - left->outstandingBytes);
161 const int r = (right->cwnd - right->outstandingBytes);
Referenced by stateEntered().
◆ pathMapLargestSpaceAndSSThreshold()
167 if (left->ssthresh != right->ssthresh) {
168 return left->ssthresh > right->ssthresh;
171 const int l = (left->cwnd - left->outstandingBytes);
172 const int r = (right->cwnd - right->outstandingBytes);
Referenced by stateEntered().
◆ pathMapLargestSSThreshold()
155 return left->ssthresh > right->ssthresh;
Referenced by stateEntered().
◆ pathMapRandomized()
145 return left->sendAllRandomizer < right->sendAllRandomizer;
Referenced by stateEntered().
◆ pathMapSmallestLastTransmission()
150 return left->lastTransmission < right->lastTransmission;
Referenced by stateEntered().
◆ pathStatusIndication()
| void inet::sctp::SctpAssociation::pathStatusIndication |
( |
const SctpPathVariables * |
path, |
|
|
bool |
status |
|
) |
| |
|
protected |
◆ pathStreamSchedulerManual()
| int32_t inet::sctp::SctpAssociation::pathStreamSchedulerManual |
( |
SctpPathVariables * |
path, |
|
|
bool |
peek |
|
) |
| |
|
protected |
474 if (path == iterator->second)
478 EV_INFO <<
"Stream Scheduler: about to send on " << pathNo + 1 <<
". path" << endl;
487 EV_DETAIL <<
"Stream Scheduler: chose sid " << sid <<
".\n";
500 int32_t thisPath = -1;
501 int32_t workingPaths = 0;
504 if (myPath->activePath) {
505 if (myPath == path) {
506 thisPath = workingPaths;
511 if (thisPath == -1) {
512 std::cout <<
"THIS PATH IS NOT WORKING???" << endl;
517 for (SctpSendStreamMap::const_iterator iterator =
sendStreams.begin();
520 SctpSendStream *stream = iterator->second;
Referenced by SctpAssociation().
◆ pathStreamSchedulerMapToPath()
| int32_t inet::sctp::SctpAssociation::pathStreamSchedulerMapToPath |
( |
SctpPathVariables * |
path, |
|
|
bool |
peek |
|
) |
| |
|
protected |
526 sid = stream->getStreamId();
532 EV_INFO <<
"pathStreamSchedulerMapToPath sid=" << sid
533 <<
" path=" << path->remoteAddress
534 <<
" (path " << (1 + thisPath)
535 <<
" of " << workingPaths <<
")" << endl;
Referenced by SctpAssociation().
◆ peekAbandonedChunk()
2382 SctpDataVariables *retChunk =
nullptr;
2386 SctpDataVariables *chunk = elem.second;
2388 if (chunk->getLastDestinationPath() == path) {
2390 if (!chunk->hasBeenAbandoned && !chunk->hasBeenAcked &&
2391 (chunk->hasBeenFastRetransmitted || chunk->hasBeenTimerBasedRtxed))
2393 switch (chunk->prMethod) {
2395 if (chunk->expiryTime > 0 && chunk->expiryTime <= simTime()) {
2396 if (!chunk->hasBeenAbandoned) {
2397 EV_DETAIL <<
"TSN " << chunk->tsn <<
" will be abandoned"
2398 <<
" (expiryTime=" << chunk->expiryTime
2399 <<
" sendTime=" << chunk->sendTime <<
")" << endl;
2400 chunk->hasBeenAbandoned =
true;
2407 if (chunk->hasBeenFastRetransmitted && chunk->numberOfRetransmissions >= chunk->allowedNoRetransmissions) {
2408 if (!chunk->hasBeenAbandoned) {
2409 EV_DETAIL <<
"peekAbandonedChunk: TSN " << chunk->tsn <<
" will be abandoned"
2410 <<
" (maxRetransmissions=" << chunk->allowedNoRetransmissions <<
")" << endl;
2411 chunk->hasBeenAbandoned =
true;
2419 if (chunk->hasBeenAbandoned && chunk->sendForwardIfAbandoned) {
Referenced by processPacketDropArrived(), and sendOnPath().
◆ peekOutboundDataMsg()
| SctpDataMsg* inet::sctp::SctpAssociation::peekOutboundDataMsg |
( |
| ) |
|
|
protected |
◆ performStateTransition()
| bool inet::sctp::SctpAssociation::performStateTransition |
( |
const SctpEventCode & |
event | ) |
|
|
protected |
◆ pmClearPathCounter()
2811 path->pathErrorCount = 0;
2812 if (path->activePath ==
false) {
2815 EV_INFO <<
"Path " << path->remoteAddress
2816 <<
" state changes from INACTIVE to ACTIVE !!!" << endl;
2817 path->activePath =
true;
Referenced by processHeartbeatAckArrived(), and processSackArrived().
◆ pmDataIsSentOn()
2735 startTimer(path->HeartbeatTimer, path->heartbeatTimeout);
2736 EV_DETAIL <<
"Restarting HB timer on path " << path->remoteAddress
2737 <<
" to expire at time " << path->heartbeatTimeout << endl;
2741 path->cwndTimeout = path->pathRto;
2743 startTimer(path->CwndTimer, path->cwndTimeout);
2745 EV_INFO <<
"Restarting CWND timer on path " << path->remoteAddress
2746 <<
" to expire at time " << path->cwndTimeout << endl;
Referenced by sendOnPath().
◆ pmRttMeasurement()
| void inet::sctp::SctpAssociation::pmRttMeasurement |
( |
SctpPathVariables * |
path, |
|
|
const simtime_t & |
rttEstimation |
|
) |
| |
|
protected |
2839 if (rttEstimation < SIMTIME_MAX) {
2840 if (simTime() > path->rttUpdateTime) {
2841 if (path->rttUpdateTime == SIMTIME_ZERO) {
2842 path->rttvar = rttEstimation.dbl() / 2;
2843 path->srtt = rttEstimation;
2844 path->pathRto = 3.0 * rttEstimation.dbl();
2848 path->rttvar = (1.0 -
sctpMain->par(
"rtoBeta").doubleValue()) * path->rttvar.dbl()
2849 +
sctpMain->par(
"rtoBeta").doubleValue() * fabs(path->srtt.dbl() - rttEstimation.dbl());
2850 path->srtt = (1.0 -
sctpMain->par(
"rtoAlpha").doubleValue()) * path->srtt.dbl()
2851 +
sctpMain->par(
"rtoAlpha").doubleValue() * rttEstimation.dbl();
2852 path->pathRto = path->srtt.dbl() + 4.0 * path->rttvar.dbl();
2857 path->rttUpdateTime = simTime() + path->srtt;
2858 path->statisticsPathRTO->record(path->pathRto);
2859 path->statisticsPathRTT->record(rttEstimation);
Referenced by processHeartbeatAckArrived(), and processSackArrived().
◆ pmStartPathManagement()
| void inet::sctp::SctpAssociation::pmStartPathManagement |
( |
| ) |
|
|
protected |
Flow control.
2752 const NetworkInterface *rtie;
2759 path->pathErrorCount = 0;
2761 path->pmtu = rtie->
getMtu();
2762 EV_DETAIL <<
"Path MTU of Interface " << i <<
" = " << path->pmtu <<
"\n";
2771 path->srtt = path->pathRto;
2772 path->rttvar = SIMTIME_ZERO;
2774 path->rttUpdateTime = SIMTIME_ZERO;
2776 path->partialBytesAcked = 0;
2777 path->outstandingBytes = 0;
2778 path->activePath =
true;
2783 path->confirmed =
true;
2785 EV_DETAIL << getFullPath() <<
" numberOfLocalAddresses=" <<
state->
localAddresses.size() <<
"\n";
2789 if (!path->confirmed)
2791 startTimer(path->HeartbeatTimer, path->heartbeatTimeout);
2792 startTimer(path->HeartbeatIntervalTimer, path->heartbeatIntervalTimeout);
2794 path->statisticsPathRTO->record(path->pathRto);
Referenced by stateEntered().
◆ preanalyseAppCommandEvent()
| SctpEventCode inet::sctp::SctpAssociation::preanalyseAppCommandEvent |
( |
int32_t |
commandCode | ) |
|
|
protected |
Maps app command codes (msg kind of app command msgs) to SCTP_E_xxx event codes.
998 switch (commandCode) {
1063 EV_DETAIL <<
"commandCode=" << commandCode <<
"\n";
1064 throw cRuntimeError(
"Unknown message kind in app command");
Referenced by processAppCommand().
◆ printAssocBrief()
| void inet::sctp::SctpAssociation::printAssocBrief |
( |
| ) |
|
|
protected |
◆ printOutstandingTsns()
| void inet::sctp::SctpAssociation::printOutstandingTsns |
( |
| ) |
|
|
protected |
◆ printSctpPathMap()
| void inet::sctp::SctpAssociation::printSctpPathMap |
( |
| ) |
const |
◆ printSegmentBrief()
| void inet::sctp::SctpAssociation::printSegmentBrief |
( |
SctpHeader * |
sctpmsg | ) |
|
|
staticprotected |
Utility: prints important header fields.
299 EV_DETAIL <<
"." << sctpmsg->getSrcPort() <<
" > "
300 <<
"." << sctpmsg->getDestPort() <<
": "
301 <<
"initTag " << sctpmsg->getVTag() <<
"\n";
◆ process_ABORT()
| void inet::sctp::SctpAssociation::process_ABORT |
( |
SctpEventCode & |
event | ) |
|
|
protected |
431 EV_DEBUG <<
"SctpAssociationEventProc:process_ABORT; assoc=" <<
assocId << endl;
432 switch (
fsm->getState()) {
Referenced by processAppCommand().
◆ process_ASSOCIATE()
29 L3Address lAddr, rAddr;
30 SctpOpenReq *openCmd = check_and_cast<SctpOpenReq *>(sctpCommand);
31 auto request = check_and_cast<Request *>(msg);
32 auto&
tags = request->getTags();
34 if (interfaceReq && interfaceReq->getInterfaceId() != -1) {
38 EV_INFO <<
"SctpAssociationEventProc:process_ASSOCIATE\n";
40 switch (
fsm->getState()) {
42 if (msg->getContextPointer() !=
nullptr) {
48 EV_INFO <<
"process_ASSOCIATE: number of local addresses=" <<
localAddressList.size() <<
"\n";
49 lAddr = openCmd->getLocalAddresses().front();
50 if (!(openCmd->getRemoteAddresses().empty())) {
52 rAddr = openCmd->getRemoteAddresses().front();
55 rAddr = openCmd->getRemoteAddr();
58 EV_DETAIL <<
"open active with fd=" <<
fd <<
" and assocId=" <<
assocId << endl;
59 fd = openCmd->getFd();
65 throw cRuntimeError(
"Error processing command OPEN_ACTIVE: remote address and port must be specified");
70 EV_INFO <<
"OPEN: " << lAddr <<
":" <<
localPort <<
" --> " << rAddr <<
":" <<
remotePort <<
"\n";
79 throw cRuntimeError(
"Error processing command OPEN_ACTIVE: connection already exists");
Referenced by processAppCommand().
◆ process_CLOSE()
| void inet::sctp::SctpAssociation::process_CLOSE |
( |
SctpEventCode & |
event | ) |
|
|
protected |
414 EV_DEBUG <<
"SctpAssociationEventProc:process_CLOSE; assoc=" <<
assocId << endl;
415 switch (
fsm->getState()) {
◆ process_OPEN_PASSIVE()
88 SctpOpenReq *openCmd = check_and_cast<SctpOpenReq *>(sctpCommand);
90 EV_DEBUG <<
"SctpAssociationEventProc:process_OPEN_PASSIVE\n";
92 switch (
fsm->getState()) {
94 if (msg->getContextPointer() !=
nullptr)
99 EV_DEBUG <<
"process_OPEN_PASSIVE: number of local addresses=" <<
localAddressList.size() <<
"\n";
100 lAddr = openCmd->getLocalAddresses().front();
105 fd = openCmd->getFd();
106 EV_DETAIL <<
"open listening socket with fd=" <<
fd <<
" and assocId=" <<
assocId << endl;
114 throw cRuntimeError(
"Error processing command OPEN_PASSIVE: local port must be specified");
116 EV_DEBUG <<
"Assoc " <<
assocId <<
"::Starting to listen on: " << lAddr <<
":" <<
localPort <<
"\n";
122 throw cRuntimeError(
"Error processing command OPEN_PASSIVE: connection already exists");
Referenced by processAppCommand().
◆ process_PRIMARY()
327 SctpPathInfo *pinfo = check_and_cast<SctpPathInfo *>(sctpCommand);
Referenced by processAppCommand().
◆ process_QUEUE_BYTES_LIMIT()
| void inet::sctp::SctpAssociation::process_QUEUE_BYTES_LIMIT |
( |
const SctpCommandReq * |
sctpCommand | ) |
|
|
protected |
408 const SctpInfoReq *qinfo = check_and_cast<const SctpInfoReq *>(sctpCommand);
Referenced by processAppCommand().
◆ process_QUEUE_MSGS_LIMIT()
| void inet::sctp::SctpAssociation::process_QUEUE_MSGS_LIMIT |
( |
const SctpCommandReq * |
sctpCommand | ) |
|
|
protected |
Queue Management.
402 const SctpInfoReq *qinfo = check_and_cast<const SctpInfoReq *>(sctpCommand);
Referenced by processAppCommand().
◆ process_RCV_Message()
72 EV_DEBUG << getFullPath() <<
" SctpAssociationRcvMessage:process_RCV_Message"
78 const uint16_t srcPort = sctpmsg->getDestPort();
79 const uint16_t destPort = sctpmsg->getSrcPort();
80 const uint32_t numberOfChunks = sctpmsg->getSctpChunksArraySize();
81 EV_DETAIL <<
"numberOfChunks=" << numberOfChunks << endl;
102 bool sendAllowed =
false;
103 bool dupReceived =
false;
104 bool dataChunkReceived =
false;
105 bool shutdownCalled =
false;
106 bool sackWasReceived =
false;
107 for (uint32_t i = 0; i < numberOfChunks; i++) {
109 SctpChunk *header = sctpmsg->removeFirstChunk();
110 const uint8_t
type = header->getSctpChunkType();
111 EV_DEBUG <<
"Header length: " << header->getByteLength() << endl;
118 EV_WARN <<
" VTag " << sctpmsg->getVTag() <<
" incorrect. Should be "
123 if (authenticationNecessary) {
125 EV_INFO <<
"AUTH received" << endl;
126 auto authChunk = check_and_cast<SctpAuthenticationChunk *>(header);
127 if (authChunk->getHMacIdentifier() != 1) {
130 it->second.numAuthChunksRejected++;
134 if (authChunk->getHMacOk() ==
false) {
137 it->second.numAuthChunksRejected++;
140 authenticationNecessary =
false;
142 it->second.numAuthChunksAccepted++;
155 EV_INFO <<
"INIT received" << endl;
156 auto initChunk = check_and_cast<SctpInitChunk *>(header);
157 if ((initChunk->getNoInStreams() != 0) &&
158 (initChunk->getNoOutStreams() != 0) &&
159 (initChunk->getInitTag() != 0))
163 i = numberOfChunks - 1;
169 EV_INFO <<
"INIT_ACK received" << endl;
171 auto initAckChunk = check_and_cast<SctpInitAckChunk *>(header);
172 if ((initAckChunk->getNoInStreams() != 0) &&
173 (initAckChunk->getNoOutStreams() != 0) &&
174 (initAckChunk->getInitTag() != 0))
178 else if (initAckChunk->getInitTag() == 0) {
183 i = numberOfChunks - 1;
187 EV_INFO <<
"INIT_ACK will be ignored" << endl;
192 EV_INFO <<
"COOKIE_ECHO received" << endl;
193 auto cookieEchoChunk = check_and_cast<SctpCookieEchoChunk *>(header);
200 EV_INFO <<
"COOKIE_ACK received" << endl;
202 check_and_cast<SctpCookieAckChunk *>(header);
209 EV_INFO <<
"DATA received" << endl;
211 EV_INFO <<
"DATA in state closed: send ABORT\n";
234 auto dataChunk = check_and_cast<SctpDataChunk *>(header);
251 dataChunkReceived =
true;
255 dataChunkReceived =
true;
267 dataChunkReceived =
false;
283 EV_INFO <<
"SACK chunk received" << endl;
284 auto sackChunk = check_and_cast<SctpSackChunk *>(header);
291 EV_DETAIL <<
"No more packets: send SHUTDOWN" << endl;
294 shutdownCalled =
true;
297 EV_DETAIL <<
"No more outstanding" << endl;
301 sackWasReceived =
true;
306 auto abortChunk = check_and_cast<SctpAbortChunk *>(header);
307 EV_INFO <<
"ABORT with T-Bit "
308 << abortChunk->getT_Bit() <<
" received" << endl;
318 EV_INFO <<
"HEARTBEAT received" << endl;
319 auto heartbeatChunk = check_and_cast<SctpHeartbeatChunk *>(header);
326 path->numberOfHeartbeatsRcvd++;
327 path->vectorPathRcvdHb->record(path->numberOfHeartbeatsRcvd);
333 EV_INFO <<
"HEARTBEAT_ACK received" << endl;
337 auto heartbeatAckChunk = check_and_cast<SctpHeartbeatAckChunk *>(header);
347 EV_INFO <<
"SHUTDOWN received" << endl;
348 auto shutdownChunk = check_and_cast<SctpShutdownChunk *>(header);
350 simtime_t rttEstimation = SIMTIME_MAX;
366 EV_INFO <<
"SHUTDOWN_ACK received" << endl;
368 check_and_cast<SctpShutdownAckChunk *>(header);
373 EV_DETAIL <<
"state=" <<
stateName(
fsm->getState()) << endl;
392 EV_INFO <<
"Shutdown Complete arrived" << endl;
393 check_and_cast<SctpShutdownCompleteChunk *>(header);
407 EV_INFO <<
"FORWARD_TSN received" << endl;
408 auto forwChunk = check_and_cast<SctpForwardTsnChunk *>(header);
412 dataChunkReceived =
true;
418 EV_INFO <<
"StreamReset received" << endl;
423 auto strResChunk = check_and_cast<SctpStreamResetChunk *>(header);
432 EV_INFO <<
"ASCONF received" << endl;
436 SctpAsconfChunk *asconfChunk;
437 asconfChunk = check_and_cast<SctpAsconfChunk *>(header);
444 EV_INFO <<
"ASCONF_ACK received" << endl;
445 auto asconfAckChunk = check_and_cast<SctpAsconfAckChunk *>(header);
454 EV_INFO <<
"PKTDROP received" << endl;
456 auto packetDropChunk = check_and_cast<SctpPacketDropChunk *>(header);
457 if (packetDropChunk->getBFlag() && !packetDropChunk->getMFlag())
467 EV_INFO <<
"ERROR received" << endl;
468 auto errorChunk = check_and_cast<SctpErrorChunk *>(header);
476 EV_ERROR <<
"different type" << endl;
480 if (i == numberOfChunks - 1 && ((dataChunkReceived && !
state->
sackAlreadySent) || dupReceived)) {
482 EV_DEBUG <<
"i=" << i <<
" sendAllowed=true; scheduleSack" << endl;
490 EV_DETAIL <<
"SctpAssociationRcvMessage: send new data? state=" <<
stateName(
fsm->getState())
491 <<
" sendAllowed=" << sendAllowed
492 <<
" shutdownCalled=" << shutdownCalled << endl;
519 if (sackWasReceived) {
521 sackWasReceived =
false;
Referenced by processSctpMessage().
◆ process_RECEIVE_REQUEST()
316 EV_INFO <<
"SctpAssociation::process_RECEIVE_REQUEST\n";
317 SctpSendReq *sendCommand = check_and_cast<SctpSendReq *>(sctpCommand);
318 if ((uint32_t)sendCommand->getSid() >
inboundStreams || sendCommand->getSid() < 0) {
319 EV_DEBUG <<
"Application tries to read from invalid stream id....\n";
Referenced by processAppCommand().
◆ process_SEND()
128 SctpSendReq *sendCommand = check_and_cast<SctpSendReq *>(sctpCommand);
133 EV_DEBUG <<
"process_SEND: state is not SCTP_S_ESTABLISHED -> returning" << endl;
137 EV_INFO <<
"process_SEND:"
141 <<
" cmdRemoteAddr=" << sendCommand->getRemoteAddr()
142 <<
" cmdPrimary=" << (sendCommand->getPrimary() ?
"true" :
"false")
144 <<
" streamId=" << sendCommand->getSid() << endl;
146 Packet *applicationPacket = check_and_cast<Packet *>(msg);
147 const auto& applicationData = applicationPacket->peekDataAsBytes();
148 int sendBytes =
B(applicationData->getChunkLength()).get();
149 EV_INFO <<
"got msg of length " << applicationData->getChunkLength() <<
" sendBytes=" << sendBytes << endl;
152 iter->second.sentBytes += sendBytes;
155 const uint32_t streamId = sendCommand->getSid();
156 const uint32_t sendUnordered = sendCommand->getSendUnordered();
157 const uint32_t ppid = sendCommand->getPpid();
158 SctpSendStream *stream =
nullptr;
161 stream = associter->second;
164 throw cRuntimeError(
"Stream with id %d not found", streamId);
167 SctpDataMsg *datMsg =
new SctpDataMsg();
168 SctpSimpleMessage *smsg =
new SctpSimpleMessage();
169 smsg->setDataArraySize(sendBytes);
170 std::vector<uint8_t> vec = applicationData->getBytes();
171 for (
int i = 0; i < sendBytes; i++)
172 smsg->setData(i, vec[i]);
173 smsg->setDataLen(sendBytes);
174 smsg->setEncaps(
false);
175 smsg->setByteLength(sendBytes);
176 datMsg->encapsulate(smsg);
177 datMsg->setSid(streamId);
178 datMsg->setPpid(ppid);
179 datMsg->setEnqueuingTime(simTime());
180 datMsg->setSackNow(sendCommand->getSackNow());
183 datMsg->setPrMethod(sendCommand->getPrMethod());
184 switch (sendCommand->getPrMethod()) {
186 if (sendCommand->getPrValue() > 0) {
187 datMsg->setExpiryTime(simTime() + sendCommand->getPrValue());
192 datMsg->setRtx((uint32_t)sendCommand->getPrValue());
196 datMsg->setPriority((uint32_t)sendCommand->getPrValue());
206 uint32_t lowestPriority;
211 strq = stream->getUnorderedStreamQ();
213 strq = stream->getStreamQ();
219 for (cQueue::Iterator iter(*strq); !iter.end(); iter++) {
220 SctpDataMsg *msg = (SctpDataMsg *)(*iter);
222 if (msg->getPriority() > lowestPriority)
223 lowestPriority = msg->getPriority();
228 if (datMsg->getPriority() > lowestPriority) {
229 EV_DEBUG <<
"msg will be abandoned, buffer is full and priority too low ("
230 << datMsg->getPriority() <<
")\n";
242 if (sendCommand->getPrimary()) {
243 if (sendCommand->getRemoteAddr().isUnspecified()) {
247 datMsg->setInitialDestination(sendCommand->getRemoteAddr());
259 datMsg->setBooksize(smsg->getByteLength() +
state->
header);
270 if (sendUnordered == 1) {
271 datMsg->setOrdered(
false);
272 stream->getUnorderedStreamQ()->insert(datMsg);
275 datMsg->setOrdered(
true);
276 stream->getStreamQ()->insert(datMsg);
278 sendQueue->record(stream->getStreamQ()->getLength());
280 EV_INFO <<
"Size of send queue " << stream->getStreamQ()->getLength() << endl;
298 EV_INFO <<
"process_SEND:"
299 <<
" last=" << sendCommand->getLast()
304 if (sendCommand->getLast() ==
true) {
305 if (sendCommand->getPrimary()) {
Referenced by processAppCommand().
◆ process_STATUS()
442 auto&
tags = check_and_cast<ITaggedObject *>(msg)->getTags();
443 auto& statusInfo =
tags.addTagIfAbsent<SctpStatusReq>();
444 statusInfo->setState(
fsm->getState());
◆ process_STREAM_RESET()
| void inet::sctp::SctpAssociation::process_STREAM_RESET |
( |
SctpCommandReq * |
sctpCommand | ) |
|
|
protected |
333 EV_INFO <<
"process_STREAM_RESET request arriving from App\n";
334 SctpResetReq *rinfo = check_and_cast<SctpResetReq *>(sctpCommand);
336 if (rinfo->getRequestType() ==
ADD_BOTH) {
350 if (rinfo->getStreamsArraySize() > 0) {
351 for (uint16_t i = 0; i < rinfo->getStreamsArraySize(); i++) {
381 if ((rinfo->getRequestType() ==
SSN_TSN) ||
Referenced by processAppCommand().
◆ process_TIMEOUT_ASCONF()
3751 path->statisticsPathRTO->record(path->pathRto);
3753 startTimer(path->AsconfTimer, path->pathRto);
Referenced by processTimer().
◆ process_TIMEOUT_BLOCKING()
| void inet::sctp::SctpAssociation::process_TIMEOUT_BLOCKING |
( |
SctpPathVariables * |
path | ) |
|
|
protected |
3889 EV_INFO <<
"TIMEOUT_BLOCKING on " << path->remoteAddress
3890 <<
" cwnd=" << path->cwnd << endl;
3891 path->blockingTimeout = -1.0;
◆ process_TIMEOUT_HEARTBEAT()
| void inet::sctp::SctpAssociation::process_TIMEOUT_HEARTBEAT |
( |
SctpPathVariables * |
path | ) |
|
|
protected |
3615 bool oldState = path->activePath;
3618 if (path->activePath) {
3620 path->pathErrorCount++;
3622 EV_INFO <<
"HB timeout timer expired for path " << path->remoteAddress <<
" --> Increase Error Counters (Assoc: " <<
state->
errorCount <<
", Path: " << path->pathErrorCount <<
")\n";
3627 path->statisticsPathRTO->record(path->pathRto);
3638 oldState = path->activePath;
3639 path->activePath =
false;
3643 EV_DETAIL <<
"pathErrorCount now " << path->pathErrorCount
3648 EV_DETAIL <<
"sctp_do_hb_to_timer() : ALL PATHS INACTIVE --> closing ASSOC\n";
3652 else if (path->activePath ==
false && oldState ==
true) {
Referenced by processTimer().
◆ process_TIMEOUT_HEARTBEAT_INTERVAL()
| void inet::sctp::SctpAssociation::process_TIMEOUT_HEARTBEAT_INTERVAL |
( |
SctpPathVariables * |
path, |
|
|
bool |
force |
|
) |
| |
|
protected |
3597 EV_INFO <<
"HB Interval timer expired -- sending new HB REQ on path " << path->remoteAddress <<
"\n";
3599 stopTimer(path->HeartbeatIntervalTimer);
3602 path->heartbeatTimeout = path->pathRto;
3603 startTimer(path->HeartbeatIntervalTimer, path->heartbeatIntervalTimeout);
3607 startTimer(path->HeartbeatTimer, path->heartbeatTimeout);
3609 path->forceHb =
false;
Referenced by processTimer().
◆ process_TIMEOUT_INIT_REXMIT()
| void inet::sctp::SctpAssociation::process_TIMEOUT_INIT_REXMIT |
( |
SctpEventCode & |
event | ) |
|
|
protected |
3547 EV_INFO <<
"Retransmission count during connection setup exceeds " << (int32_t)
sctpMain->
getMaxInitRetrans() <<
", giving up\n";
3553 switch (
fsm->getState()) {
3563 throw cRuntimeError(
"Internal error: INIT-REXMIT timer expired while in state %s",
Referenced by processTimer().
◆ process_TIMEOUT_PROBING()
| void inet::sctp::SctpAssociation::process_TIMEOUT_PROBING |
( |
| ) |
|
|
protected |
◆ process_TIMEOUT_RESET()
3685 std::map<uint32_t, SctpStateVariables::RequestData>::reverse_iterator rit;
3687 if (rit->second.result ==
DEFERRED) {
3694 EV_DETAIL <<
"Performing timeout reset" << endl;
3699 path->statisticsPathRTO->record(path->pathRto);
Referenced by processTimer().
◆ process_TIMEOUT_RTX()
3759 EV_DETAIL <<
"Processing retransmission timeout ..." << endl;
3762 if (path->BlockingTimer) {
3765 path->blockingTimeout = -1.0;
3769 path->statisticsPathRTO->record(path->pathRto);
3770 EV_DETAIL <<
"Schedule T3 based retransmission for path " << path->remoteAddress
3771 <<
" oldest chunk sent " << simTime() - path->oldestChunkSendTime <<
" ago"
3772 <<
" (TSN " << path->oldestChunkTsn <<
")" << endl;
3773 EV_DEBUG <<
"Unacked chunks in Retransmission Queue:" << endl;
3777 const SctpDataVariables *myChunk = iterator->second;
3778 if (!myChunk->hasBeenAcked) {
3780 EV_DEBUG <<
" - " << myChunk->tsn
3781 <<
"\tsent=now-" << simTime() - myChunk->sendTime
3782 <<
"\tlast=" << myChunkLastPath->remoteAddress
3783 <<
"\tmoved=" << ((myChunk->hasBeenMoved ==
true) ?
"YES!" :
"no")
3784 <<
"\tnumTX=" << myChunk->numberOfTransmissions
3785 <<
"\tnumRTX=" << myChunk->numberOfRetransmissions
3786 <<
"\tfastRTX=" << ((myChunk->hasBeenFastRetransmitted ==
true) ?
"YES!" :
"no")
3790 EV_DEBUG <<
"----------------------" << endl;
3798 path->pathErrorCount++;
3799 EV_DETAIL <<
"RTX-Timeout: errorCount increased to " << path->pathErrorCount <<
" state->errorCount=" <<
state->
errorCount <<
"\n";
3804 EV_DETAIL <<
"process_TIMEOUT_RTX : ASSOC ERROR COUNTER EXCEEDED, closing ASSOC" << endl;
3811 if (path->pathErrorCount >
static_cast<uint32_t
>(
sctpMain->par(
"pathMaxRetrans"))) {
3812 bool notifyUlp =
false;
3814 EV_DETAIL <<
"pathErrorCount exceeded\n";
3815 if (path->activePath) {
3819 path->activePath =
false;
3822 if (nextPath !=
nullptr) {
3826 EV_DETAIL <<
"process_TIMEOUT_RTX(" << path->remoteAddress
3827 <<
") : PATH ERROR COUNTER EXCEEDED, path status is INACTIVE" << endl;
3829 EV_WARN <<
"process_TIMEOUT_RTX: ALL PATHS INACTIVE --> connection LOST!" << endl;
3835 else if (notifyUlp) {
3840 EV_DETAIL <<
"process_TIMEOUT_RTX(" << path->remoteAddress
3841 <<
") : PATH ERROR COUNTER now " << path->pathErrorCount << endl;
3848 <<
" chunks in retransmissionQ" << endl;
3851 SctpDataVariables *chunk = elem.second;
3852 assert(chunk !=
nullptr);
3857 || chunk->hasBeenReneged) && (chunk->getLastDestinationPath() == path))
3860 EV_DETAIL << simTime() <<
": Timer-Based RTX for TSN " << chunk->tsn
3861 <<
": lastDestination=" << chunk->getLastDestination()
3862 <<
" lastPathRTO=" << chunk->getLastDestinationPath()->pathRto
3863 <<
" nextDestination=" << nextPath->remoteAddress
3864 <<
" nextPathRTO=" << nextPath->pathRto
3865 <<
" waiting=" << simTime() - chunk->sendTime
3867 nextPath->numberOfTimerBasedRetransmissions++;
3868 chunk->hasBeenTimerBasedRtxed =
true;
3869 chunk->sendForwardIfAbandoned =
true;
3870 chunk->numberOfTransmissions++;
3872 if (!chunk->hasBeenAbandoned) {
3874 iter->second.numT3Rtx++;
3883 EV_DETAIL <<
"TimeoutRTX: sendOnAllPaths()" << endl;
Referenced by processTimer().
◆ process_TIMEOUT_SHUTDOWN()
| void inet::sctp::SctpAssociation::process_TIMEOUT_SHUTDOWN |
( |
SctpEventCode & |
event | ) |
|
|
protected |
◆ processAddInAndOutResetRequestArrived()
2696 const auto& msg = makeShared<SctpHeader>();
2700 SctpStreamResetChunk *resetChunk =
new SctpStreamResetChunk(
"AddInOut_CONFIG");
2701 resetChunk->setSctpChunkType(
RE_CONFIG);
2704 SctpResetTimer *
rt =
new SctpResetTimer();
2706 SctpAddStreamsRequestParameter *addStreams =
new SctpAddStreamsRequestParameter(
"Add_Streams");
2709 addStreams->setNumberOfStreams(addInRequestParam->getNumberOfStreams());
2712 addStreams->setSrReqSn(srsn);
2716 resetChunk->addParameter(addStreams);
2718 SctpStreamResetChunk *responseChunk =
new SctpStreamResetChunk(
"responseRE_CONFIG");
2719 responseChunk->setSctpChunkType(
RE_CONFIG);
2721 SctpStreamResetResponseParameter *outResponseParam =
new SctpStreamResetResponseParameter(
"Out_Response_Param");
2724 outResponseParam->setSrResSn(addOutRequestParam->getSrReqSn());
2727 responseChunk->addParameter(outResponseParam);
2728 SctpStreamResetResponseParameter *inResponseParam =
new SctpStreamResetResponseParameter(
"In_Response_Param");
2731 inResponseParam->setSrResSn(addInRequestParam->getSrReqSn());
2736 responseChunk->addParameter(inResponseParam);
2737 msg->appendSctpChunks(resetChunk);
2738 msg->appendSctpChunks(responseChunk);
2740 rt->setInAcked(
true);
2742 rt->setOutAcked(
false);
2743 it->second.numResetRequestsSent++;
2749 state->
resetChunk = check_and_cast<SctpStreamResetChunk *>(resetChunk->dup());
2751 Packet *pkt =
new Packet(
"RE_CONFIG");
Referenced by processStreamResetArrived().
◆ processAppCommand()
| bool inet::sctp::SctpAssociation::processAppCommand |
( |
cMessage * |
msg, |
|
|
SctpCommandReq * |
sctpCommand |
|
) |
| |
Process commands from the application.
Normally returns true. A return value of false means that the connection structure must be deleted by the caller (SCTP).
1074 EV_INFO <<
"App command: " <<
eventName(event) <<
"\n";
1115 auto sctpSendReq = check_and_cast<SctpSendReq *>(sctpCommand);
1137 EV_INFO <<
"SCTP_E_SHUTDOWN in state " <<
stateName(
fsm->getState()) <<
"\n";
1140 EV_INFO <<
"send shutdown ack\n";
1152 fd = sctpCommand->getFd();
1153 EV_DETAIL <<
"Accepted fd " <<
fd <<
" for assoc " <<
assocId << endl;
1161 auto sctpRtoReq = check_and_cast<SctpRtoReq *>(sctpCommand);
1168 throw cRuntimeError(
"Wrong event code");
Referenced by inet::sctp::Sctp::handleMessage().
◆ processAsconfAckArrived()
3306 SctpParameter *sctpParam;
3308 SctpAsconfChunk *sctpasconf;
3309 std::vector<uint32_t> errorCorrId;
3310 bool errorFound =
false;
3313 if (asconfAckChunk->getSerialNumber() == sctpasconf->getSerialNumber()) {
3319 for (uint32_t j = 0; j < asconfAckChunk->getAsconfResponseArraySize(); j++) {
3320 sctpParam = asconfAckChunk->getAsconfResponse(j);
3322 SctpErrorCauseParameter *error = check_and_cast<SctpErrorCauseParameter *>(sctpParam);
3323 errorCorrId.push_back(error->getResponseCorrelationId());
3324 EV_INFO <<
"error added with id " << error->getResponseCorrelationId() <<
"\n";
3327 for (uint32_t i = 0; i < sctpasconf->getAsconfParamsArraySize(); i++) {
3328 sctpParam =
CHK(sctpasconf->removeAsconfParam());
3330 switch (sctpParam->getParameterType()) {
3332 SctpAddIPParameter *ipParam;
3333 ipParam = check_and_cast<SctpAddIPParameter *>(sctpParam);
3334 if (errorCorrId.size() > 0) {
3335 for (
auto& elem : errorCorrId)
3336 if ((elem) == ipParam->getRequestCorrelationId()) {
3341 if (errorFound ==
true) {
3345 addr = ipParam->getAddressParam();
3346 if (addr.isUnspecified()) {
3356 SctpDeleteIPParameter *delParam;
3357 delParam = check_and_cast<SctpDeleteIPParameter *>(sctpParam);
3358 if (errorCorrId.size() > 0) {
3359 for (
auto& elem : errorCorrId) {
3360 if ((elem) == delParam->getRequestCorrelationId()) {
3366 if (errorFound ==
true) {
3370 addr = delParam->getAddressParam();
3374 EV_DETAIL <<
"erase address " << (*j) <<
"\n";
3383 SctpSetPrimaryIPParameter *priParam;
3384 priParam = check_and_cast<SctpSetPrimaryIPParameter *>(sctpParam);
3385 if (errorCorrId.size() > 0) {
3386 for (
auto& elem : errorCorrId) {
3387 if ((elem) == priParam->getRequestCorrelationId()) {
3393 if (errorFound ==
true) {
Referenced by process_RCV_Message().
◆ processAsconfArrived()
3172 SctpParameter *sctpParam;
3175 std::vector<L3Address> locAddr;
3176 SctpAuthenticationChunk *authChunk;
3177 EV_INFO <<
"Asconf arrived " << asconfChunk->getName() <<
"\n";
3179 const auto& sctpAsconfAck = makeShared<SctpHeader>();
3185 sctpAsconfAck->appendSctpChunks(authChunk);
3187 it->second.numAuthChunksSent++;
3192 int32_t
count = asconfChunk->getAsconfParamsArraySize();
3193 EV_DETAIL <<
"Number of Asconf parameters=" <<
count <<
"\n";
3194 for (int32_t
c = 0;
c <
count;
c++) {
3195 sctpParam = (SctpParameter *)(asconfChunk->removeAsconfParam());
3196 switch (sctpParam->getParameterType()) {
3198 EV_INFO <<
"ADD_IP_PARAMETER\n";
3199 SctpAddIPParameter *ipParam;
3200 ipParam = check_and_cast<SctpAddIPParameter *>(sctpParam);
3201 addr = ipParam->getAddressParam();
3202 if (addr.isUnspecified()) {
3203 EV_INFO <<
"no address specified, add natted address " <<
remoteAddr <<
"\n";
3210 EV_INFO <<
"add remote address " << addr <<
" to local address " << (elem) <<
"\n";
3217 stopTimer(path->HeartbeatIntervalTimer);
3218 path->statisticsPathRTO->record(path->pathRto);
3219 startTimer(path->HeartbeatIntervalTimer, path->pathRto);
3220 path->forceHb =
true;
3223 path->confirmed =
true;
3228 SctpDeleteIPParameter *delParam;
3229 delParam = check_and_cast<SctpDeleteIPParameter *>(sctpParam);
3230 addr = delParam->getAddressParam();
3232 SctpErrorCauseParameter *errorParam;
3233 errorParam =
new SctpErrorCauseParameter(
"ErrorCause");
3235 errorParam->setResponseCorrelationId(delParam->getRequestCorrelationId());
3238 errorParam->encapsulate(delParam->dup());
3240 asconfAckChunk->addAsconfResponse(errorParam);
3243 EV_INFO <<
"addr=remoteAddr, make Error Parameter\n";
3244 SctpErrorCauseParameter *errParam;
3245 errParam =
new SctpErrorCauseParameter(
"ErrorCause");
3248 errParam->setResponseCorrelationId(delParam->getRequestCorrelationId());
3251 errParam->encapsulate(delParam->dup());
3252 asconfAckChunk->addAsconfResponse(errParam);
3258 EV_INFO <<
"remove path from address " << addr <<
"\n";
3265 EV_INFO <<
"SET_PRIMARY_ADDRESS\n";
3266 SctpSetPrimaryIPParameter *priParam;
3267 priParam = check_and_cast<SctpSetPrimaryIPParameter *>(sctpParam);
3268 addr = priParam->getAddressParam();
3269 if (addr.isUnspecified()) {
3270 EV_INFO <<
"no address specified, add natted address " <<
remoteAddr <<
"\n";
3274 if ((elem) == addr) {
3275 if (
getPath(addr)->confirmed ==
true) {
3277 EV_INFO <<
"set primaryPath to " << addr <<
"\n";
3291 sctpAsconfAck->appendSctpChunks(asconfAckChunk);
3292 Packet *pkt =
new Packet(
"ASCONF-ACK");
3297 const char *
type =
sctpMain->par(
"addIpType").stringValue();
Referenced by process_RCV_Message().
◆ processCookieAckArrived()
| bool inet::sctp::SctpAssociation::processCookieAckArrived |
( |
| ) |
|
|
protected |
◆ processCookieEchoArrived()
818 const SctpCookie *cookie = cookieEcho->getStateCookie();
819 if (cookie->getCreationTime() + simtime_t(
sctpMain->par(
"validCookieLifetime")) < simTime()) {
820 EV_INFO <<
"stale Cookie: sendAbort\n";
828 for (int32_t i = 0; i < 32; i++) {
844 EV_INFO <<
"State is CLOSED, Cookie_Ack has to be sent\n";
850 EV_INFO <<
"State is not CLOSED, but COOKIE_ECHO received. Compare the Tags\n";
854 for (int32_t i = 0; i < 32; i++) {
871 else if (cookie->getPeerTag() ==
peerVTag && (cookie->getLocalTag() !=
localVTag || cookie->getLocalTag() == 0)) {
877 else if (cookie->getPeerTag() ==
peerVTag && cookie->getLocalTag() ==
localVTag) {
883 EV_DETAIL <<
"State=" <<
fsm->getState() <<
"\n";
Referenced by process_RCV_Message().
◆ processDataArrived()
2111 const uint32_t tsn = dataChunk->getTsn();
2129 EV_INFO << simTime() <<
" SctpAssociation::processDataArrived TSN=" << tsn << endl;
2131 if (dataChunk->getIBit()) {
2139 if (payloadLength == 0) {
2140 EV_DETAIL <<
"No user data. Send ABORT" << endl;
2144 EV_DETAIL <<
"state->bytesRcvd now=" <<
state->
bytesRcvd << endl;
2145 path->numberOfBytesReceived += payloadLength;
2147 iter->second.rcvdBytes += payloadLength;
2162 EV_DETAIL << simTime() <<
": Duplicate TSN " << tsn <<
" (smaller than CumAck)" << endl;
2165 path->numberOfDuplicates++;
2174 EV_DETAIL <<
"Duplicate TSN " << tsn <<
" (copy)" << endl;
2177 path->numberOfDuplicates++;
2195 EV_DETAIL <<
"Receive buffer full (case 1): sendPacketDrop" << endl;
2198 iter->second.numDropsBecauseNewTsnGreaterThanHighestTsn++;
2202 else if ((tsn < state->gapList.getHighestTsnReceived()) &&
2207 EV_DETAIL <<
"Receive buffer full (case 2): sendPacketDrop" << endl;
2210 iter->second.numDropsBecauseNoRoomInBuffer++;
2225 EV_TRACE <<
"swsAvoidanceInvoked" << endl;
2237 const int ret = iter->second->enqueueNewDataChunk(
makeVarFromMsg(dataChunk));
2250 char vectorName[128];
2251 snprintf(vectorName,
sizeof(vectorName),
"Stream %d Throughput", i);
Referenced by process_RCV_Message().
◆ processErrorArrived()
| void inet::sctp::SctpAssociation::processErrorArrived |
( |
SctpErrorChunk * |
error | ) |
|
|
protected |
3520 uint32_t parameterType;
3521 for (uint32_t i = 0; i < errorChunk->getParametersArraySize(); i++) {
3522 SctpParameter *param = (SctpParameter *)errorChunk->getParameters(i);
3523 parameterType = param->getParameterType();
3524 switch (parameterType) {
3526 if (
sctpMain->par(
"addIP").boolValue()) {
3530 const char *
type =
sctpMain->par(
"addIpType").stringValue();
Referenced by process_RCV_Message().
◆ processForwardTsnArrived()
2070 EV_TRACE <<
"processForwardTsnArrived\n";
2071 EV_INFO <<
"last state->cTsnAck=" <<
state->
gapList.
getCumAckTsn() <<
" fwCumAck=" << fwChunk->getNewCumTsn() <<
"\n";
2078 for (uint32_t i = 0; i < fwChunk->getSidArraySize(); i++) {
2079 if (fwChunk->getSsn(i) != -1) {
2081 SctpReceiveStream *rStream = iter->second;
2087 if (rStream->getOrderedQ()->getQueueSize() > 0)
2088 rStream->setExpectedStreamSeqNum(rStream->getOrderedQ()->getFirstSsnInQueue(fwChunk->getSid(i)));
2089 else if (rStream->getExpectedStreamSeqNum() <= fwChunk->getSsn(i))
2090 rStream->setExpectedStreamSeqNum(fwChunk->getSsn(i) + 1);
2091 if (rStream->getExpectedStreamSeqNum() > 65535) {
2092 rStream->setExpectedStreamSeqNum(0);
Referenced by process_RCV_Message().
◆ processHeartbeatAckArrived()
2274 path->numberOfHeartbeatAcksRcvd++;
2275 path->vectorPathRcvdHbAck->record(path->numberOfHeartbeatAcksRcvd);
2277 const L3Address addr = hback->getRemoteAddr();
2278 const simtime_t hbTimeField = hback->getTimeField();
2281 simtime_t rttEstimation = simTime() - hbTimeField;
2284 path->confirmed =
true;
2285 path->lastAckTime = simTime();
2286 if (path->primaryPathCandidate ==
true) {
2288 path->primaryPathCandidate =
false;
2297 if (path->activePath ==
false) {
2298 EV_INFO <<
"HB ACK arrived activePath=false. remoteAddress=" << path->remoteAddress
2300 path->activePath =
true;
2306 EV_INFO <<
"Received HB ACK chunk...resetting error counters on path " << addr
2307 <<
", rttEstimation=" << rttEstimation << endl;
2308 path->pathErrorCount = 0;
Referenced by process_RCV_Message().
◆ processInAndOutResetRequestArrived()
2637 uint32_t inSrSn = 0;
2638 uint32_t outSrSn = 0;
2640 uint16_t outRes = 0;
2649 if (outRequestParam->getStreamNumbersArraySize() > 0) {
2651 for (uint16_t i = 0; i < outRequestParam->getStreamNumbersArraySize(); i++) {
2653 outSrSn = outRequestParam->getSrReqSn();
2660 for (uint16_t i = 0; i < outRequestParam->getStreamNumbersArraySize(); i++) {
2667 EV_DETAIL <<
"processInAndOutResetRequestArrived: resetExpectedSsns\n";
2670 if (inRequestParam->getStreamNumbersArraySize() > 0) {
2672 for (uint16_t i = 0; i < inRequestParam->getStreamNumbersArraySize(); i++) {
2674 inSrSn = inRequestParam->getSrReqSn();
2686 if (inSrSn > 0 && outSrSn > 0) {
Referenced by processStreamResetArrived().
◆ processIncomingResetRequestArrived()
2400 if (requestParam->getStreamNumbersArraySize() > 0) {
2401 for (uint16_t i = 0; i < requestParam->getStreamNumbersArraySize(); i++) {
2410 if (num == requestParam->getStreamNumbersArraySize()) {
2414 for (uint16_t i = 0; i < requestParam->getStreamNumbersArraySize(); i++) {
2427 EV_TRACE <<
"processIncomingResetRequestArrived: sendOutgoingResetRequestArrived returned\n";
2431 if (requestParam->getStreamNumbersArraySize() > 0) {
2434 for (uint16_t i = 0; i < requestParam->getStreamNumbersArraySize(); i++) {
2444 resetSsn(requestParam->getStreamNumbers(i));
Referenced by checkStreamsToReset(), and processStreamResetArrived().
◆ processInitAckArrived()
| bool inet::sctp::SctpAssociation::processInitAckArrived |
( |
SctpInitAckChunk * |
initAckChunk | ) |
|
|
protected |
736 EV_INFO <<
"State is COOKIE_WAIT, Cookie_Echo has to be sent\n";
748 if (initAckChunk->getMsg_rwnd() > 0) {
761 if (!((elem).isUnspecified())) {
762 EV_INFO <<
"addPath " << initAckChunk->getAddresses(j) <<
"\n";
765 addPath(initAckChunk->getAddresses(j));
771 EV_INFO <<
" get new path for " <<
remoteAddr <<
"\n";
783 if (initAckChunk->getHmacTypesArraySize() != 0) {
785 for (uint32_t j = 0; j < initAckChunk->getSctpChunkTypesArraySize(); j++) {
786 type = initAckChunk->getSctpChunkTypes(j);
792 if (initAckChunk->getSepChunksArraySize() > 0) {
793 for (uint32_t i = 0; i < initAckChunk->getSepChunksArraySize(); i++) {
794 if (initAckChunk->getSepChunks(i) ==
RE_CONFIG) {
798 if (initAckChunk->getSepChunks(i) ==
PKTDROP) {
809 EV_DETAIL <<
"State=" <<
fsm->getState() <<
"\n";
Referenced by process_RCV_Message().
◆ processInitArrived()
| bool inet::sctp::SctpAssociation::processInitArrived |
( |
SctpInitChunk * |
initChunk, |
|
|
int32_t |
sport, |
|
|
int32_t |
dport |
|
) |
| |
|
protected |
Process incoming SCTP packets.
Invoked from process_RCV_Message
540 EV_TRACE <<
"processInitArrived\n";
544 EV_TRACE <<
"cloneAssociation\n";
546 EV_TRACE <<
"addForkedAssociation\n";
548 assoc->listening =
true;
551 EV_INFO <<
"Connection forked: this connection got new assocId=" <<
assocId <<
", "
552 "spinoff keeps LISTENing with assocId=" << assoc->assocId <<
"\n";
553 snprintf(timerName,
sizeof(timerName),
"T2_SHUTDOWN of assoc %d",
assocId);
555 snprintf(timerName,
sizeof(timerName),
"T5_SHUTDOWN_GUARD of assoc %d",
assocId);
557 snprintf(timerName,
sizeof(timerName),
"SACK_TIMER of assoc %d",
assocId);
559 snprintf(timerName,
sizeof(timerName),
"T1_INIT of assoc %d",
assocId);
569 if (initchunk->getAddressesArraySize() == 0) {
570 EV_INFO <<
" get new path for " <<
remoteAddr <<
"\n";
580 if (initchunk->getMsg_rwnd() > 0) {
593 #ifdef INET_WITH_IPv4
595 adv.push_back(ipv4Data->getIPAddress());
598 #endif // ifdef INET_WITH_IPv4
599 #ifdef INET_WITH_IPv6
601 adv.push_back(ipv6Data->getAddress(0));
604 #endif // ifdef INET_WITH_IPv6
605 throw cRuntimeError(
"INET was compiled without IPv4/IPv6 support");
612 if (adv.size() == 1) {
615 else if (rlevel > 0) {
616 for (
auto& elem : adv) {
623 for (uint32_t j = 0; j < initchunk->getAddressesArraySize(); j++) {
628 if (!
getPath(initchunk->getAddresses(j))) {
630 EV_INFO <<
" get new path for " << initchunk->getAddresses(j) <<
"\n";
644 EV_INFO <<
"Get new path for " <<
remoteAddr <<
"\n";
650 if (initchunk->getHmacTypesArraySize() != 0) {
652 for (uint32_t j = 0; j < initchunk->getSctpChunkTypesArraySize(); j++) {
653 type = initchunk->getSctpChunkTypes(j);
659 EV_DETAIL <<
"number supported extensions:" << initchunk->getSepChunksArraySize() <<
"\n";
660 if (initchunk->getSepChunksArraySize() > 0) {
661 for (uint32_t i = 0; i < initchunk->getSepChunksArraySize(); i++) {
662 if (initchunk->getSepChunks(i) ==
RE_CONFIG) {
666 if (initchunk->getSepChunks(i) ==
PKTDROP) {
668 EV_DEBUG <<
"set peerPktDrop to true\n";
689 EV_INFO <<
"INIT collision: send Init-Ack\n";
690 if (initchunk->getHmacTypesArraySize() != 0) {
693 for (uint32_t j = 0; j < initchunk->getSctpChunkTypesArraySize(); j++) {
694 type = initchunk->getSctpChunkTypes(j);
706 bool addressPresent =
false;
707 for (uint32_t j = 0; j < initchunk->getAddressesArraySize(); j++) {
711 if ((elem) == (initchunk->getAddresses(j))) {
712 addressPresent =
true;
716 if (!addressPresent) {
Referenced by process_RCV_Message().
◆ processOutAndResponseArrived()
2760 EV_INFO <<
"processOutAndResponseArrived\n";
2763 SctpResetTimer *tm = check_and_cast<SctpResetTimer *>(
getPath(
remoteAddr)->ResetTimer->decapsulate());
2764 if (tm->getOutSN() == responseParam->getSrResSn()) {
2773 if (outRequestParam->getStreamNumbersArraySize() > 0) {
2774 for (uint16_t i = 0; i < outRequestParam->getStreamNumbersArraySize(); i++) {
2784 if (responseParam->getResult() ==
PERFORMED) {
2786 std::list<uint16_t>::iterator iter;
2787 if (
state->
requests[responseParam->getSrResSn()].streams.size() > 0) {
2788 for (iter =
state->
requests[responseParam->getSrResSn()].streams.begin(); iter !=
state->
requests[responseParam->getSrResSn()].streams.end(); iter++) {
2799 it->second.numResetRequestsPerformed++;
2803 EV_INFO <<
"Reset Request failed. Send indication to app.\n";
2807 state->
requests[responseParam->getSrResSn()].result = responseParam->getResult();
Referenced by processStreamResetArrived().
◆ processOutgoingResetRequestArrived()
2314 EV_TRACE <<
"processOutgoingResetRequestArrived\n";
2328 SctpResetTimer *tm = check_and_cast<SctpResetTimer *>(
PK(
getPath(
remoteAddr)->ResetTimer)->decapsulate());
2329 if ((tm->getOutSN() == requestParam->getSrResSn() && !tm->getOutAcked()) ||
2330 (tm->getInSN() == requestParam->getSrResSn() && !tm->getInAcked()))
2342 if (requestParam->getStreamNumbersArraySize() > 0) {
2344 for (uint16_t i = 0; i < requestParam->getStreamNumbersArraySize(); i++) {
2359 if (requestParam->getStreamNumbersArraySize() > 0) {
2360 for (uint16_t i = 0; i < requestParam->getStreamNumbersArraySize(); i++) {
2367 EV_DETAIL <<
"processOutgoingResetRequestArrived: resetExpectedSsns\n";
Referenced by processStreamResetArrived().
◆ processPacketDropArrived()
3409 bool dataReceived =
false;
3411 if (packetDropChunk->getMFlag() ==
false) {
3412 EV_TRACE <<
"processPacketDropArrived" << endl;
3413 if (packetDropChunk->getEncapsulatedPacket() !=
nullptr) {
3414 SctpHeader *sctpmsg = (SctpHeader *)(packetDropChunk->decapsulate());
3415 const uint32_t numberOfChunks = sctpmsg->getChunksArraySize();
3416 EV_DETAIL <<
"numberOfChunks=" << numberOfChunks << endl;
3417 for (uint32_t i = 0; i < numberOfChunks; i++) {
3418 SctpChunk *chunk = (SctpChunk *)(sctpmsg->removeChunk());
3419 const uint8_t
type = chunk->getSctpChunkType();
3422 SctpDataChunk *dataChunk = check_and_cast<SctpDataChunk *>(chunk);
3423 const uint32_t tsn = dataChunk->getTsn();
3428 EV_DETAIL << simTime() <<
": Packet Drop for TSN "
3429 << pq->second->tsn <<
" on path "
3430 << pq->second->getLastDestination()
3431 <<
" -> transmitting it again" << endl;
3434 delete dataChunk->decapsulate();
3435 dataReceived =
true;
3486 const auto& sctpmsg = makeShared<SctpHeader>();
3491 sctpmsg->appendSctpChunks(authChunk);
3493 sctpmsg->appendSctpChunks(forwardChunk);
3497 throw cRuntimeError(
"unknown chunk type");
3506 EV_INFO <<
"no chunk encapsulated" << endl;
3509 - packetDropChunk->getQueuedData()
3512 return dataReceived;
Referenced by process_RCV_Message().
◆ processResetResponseArrived()
2520 EV_INFO <<
"processResetResponseArrived \n";
2525 SctpResetTimer *tm = check_and_cast<SctpResetTimer *>(
getPath(
remoteAddr)->ResetTimer->decapsulate());
2526 EV_INFO <<
"SrResSn=" << responseParam->getSrResSn() <<
" tmOut=" << tm->getOutSN() <<
" tmIn= " << tm->getInSN() <<
"\n";
2527 if (tm->getOutSN() == responseParam->getSrResSn() || tm->getInSN() == responseParam->getSrResSn() || responseParam->getResult() >
DEFERRED) {
2538 if (responseParam->getResult() >
DEFERRED) {
2555 if (responseParam->getResult() ==
PERFORMED) {
2571 if (responseParam->getReceiversNextTsn() != 0) {
2613 it->second.numResetRequestsPerformed++;
2616 EV_INFO <<
"Reset Request failed. Send indication to app.\n";
2617 if (responseParam->getResult() ==
DEFERRED) {
2625 state->
requests[responseParam->getSrResSn()].result = responseParam->getResult();
Referenced by processStreamResetArrived().
◆ processSackArrived()
976 simtime_t rttEstimation = SIMTIME_MAX;
979 const uint64_t arwnd = sackChunk->getA_rwnd();
980 const uint32_t tsna = sackChunk->getCumTsnAck();
981 uint32_t highestNewAck = tsna;
982 const uint16_t numDups = sackChunk->getNumDupTsns();
984 bool dropFilledGap =
false;
985 const uint32_t msgRwnd = sackChunk->getMsg_rwnd();
988 SctpGapList sackGapList;
989 sackGapList.setInitialCumAckTsn(sackChunk->getCumTsnAck());
990 uint32_t lastTsn = sackChunk->getCumTsnAck();
991 for (uint32_t i = 0; i < sackChunk->getNumGaps(); i++) {
992 uint32_t tsn = sackChunk->getGapStart(i);
993 assert(
tsnLt(lastTsn + 1, tsn));
995 while (
tsnLe(tsn, sackChunk->getGapStop(i))) {
997 sackGapList.updateGapList(tsn, dummy,
true);
1000 lastTsn = sackChunk->getGapStop(i);
1003 assocStat->sumRGapRanges += ((sackChunk->getCumTsnAck() <= lastTsn) ?
1004 (uint64_t)(lastTsn - sackChunk->getCumTsnAck()) :
1005 (uint64_t)(sackChunk->getCumTsnAck() - lastTsn));
1007 if (sackChunk->getNrSubtractRGaps() ==
false) {
1008 lastTsn = sackChunk->getCumTsnAck();
1009 for (uint32_t i = 0; i < sackChunk->getNumNrGaps(); i++) {
1010 uint32_t tsn = sackChunk->getNrGapStart(i);
1011 assert(
tsnLt(lastTsn + 1, tsn));
1013 while (
tsnLe(tsn, sackChunk->getNrGapStop(i))) {
1015 sackGapList.updateGapList(tsn, dummy,
false);
1018 lastTsn = sackChunk->getNrGapStop(i);
1022 lastTsn = sackChunk->getCumTsnAck();
1023 for (uint32_t i = 0; i < sackChunk->getNumNrGaps(); i++) {
1024 uint32_t tsn = sackChunk->getNrGapStart(i);
1025 assert(
tsnLt(lastTsn + 1, tsn));
1027 while (
tsnLe(tsn, sackChunk->getNrGapStop(i))) {
1028 if (sackGapList.tsnIsRevokable(tsn) ==
false) {
1030 sackGapList.updateGapList(tsn, dummy,
false);
1034 lastTsn = sackChunk->getNrGapStop(i);
1038 assocStat->sumNRGapRanges += (sackChunk->getCumTsnAck() <= lastTsn) ?
1039 (uint64_t)(lastTsn - sackChunk->getCumTsnAck()) :
1040 (uint64_t)(sackChunk->getCumTsnAck() - lastTsn);
1045 EV_DETAIL <<
"##### SACK Processing: TSNa=" << tsna <<
" #####" << endl;
1048 EV_DETAIL <<
"Path " << myPath->remoteAddress <<
":\t"
1049 <<
"outstanding=" << path->outstandingBytes <<
"\t"
1050 <<
"T3scheduled=" << path->T3_RtxTimer->getArrivalTime() <<
" "
1051 << (path->T3_RtxTimer->isScheduled() ?
"[ok]" :
"[NOT SCHEDULED]") <<
"\t"
1052 <<
"findPseudoCumAck=" << ((myPath->findPseudoCumAck ==
true) ?
"true" :
"false") <<
"\t"
1053 <<
"pseudoCumAck=" << myPath->pseudoCumAck <<
"\t"
1054 <<
"newPseudoCumAck=" << ((myPath->newPseudoCumAck ==
true) ?
"true" :
"false") <<
"\t"
1055 <<
"findRTXPseudoCumAck=" << ((myPath->findRTXPseudoCumAck ==
true) ?
"true" :
"false") <<
"\t"
1056 <<
"rtxPseudoCumAck=" << myPath->rtxPseudoCumAck <<
"\t"
1057 <<
"newRTXPseudoCumAck=" << ((myPath->newRTXPseudoCumAck ==
true) ?
"true" :
"false") <<
"\t"
1061 EV_INFO <<
"Before processSackArrived for path " << path->remoteAddress
1062 <<
" with tsna=" << tsna <<
":" << endl;
1065 EV_INFO <<
"SACK Seq Number = " << sackChunk->getSackSeqNum() << endl;
1069 EV_DETAIL <<
"Out-of-data SACK: " << sackChunk->getSackSeqNum()
1080 path->vectorPathAckedTsnCumAck->record(tsna);
1082 assocStat->numDups += numDups;
1090 myPath->outstandingBytesBeforeUpdate = myPath->outstandingBytes;
1091 myPath->requiresRtx =
false;
1092 myPath->lowestTsnRetransmitted =
false;
1093 myPath->findLowestTsn =
true;
1094 myPath->gapAckedChunksInLastSACK = 0;
1095 myPath->gapNRAckedChunksInLastSACK = 0;
1096 myPath->gapUnackedChunksInLastSACK = 0;
1097 myPath->newlyAckedBytes = 0;
1098 myPath->newCumAck =
false;
1100 myPath->newPseudoCumAck =
false;
1101 myPath->newRTXPseudoCumAck =
false;
1102 myPath->sawNewAck =
false;
1103 myPath->lowestNewAckInSack = 0;
1104 myPath->highestNewAckInSack = 0;
1105 myPath->newOldestChunkSendTime = simTime() + 9999.99;
1106 if (myPath == path) {
1107 myPath->lastAckTime = simTime();
1124 EV_INFO <<
"===== Handling new CumAck for TSN " << tsna <<
" =====" << endl;
1127 if ((myChunk !=
nullptr) && (myChunk->wasPktDropped) &&
1128 (myChunk->getLastDestinationPath()->fastRecoveryActive))
1130 dropFilledGap =
true;
1131 EV_DETAIL <<
"TSN " << myChunk->
tsn <<
" filled gap" << endl;
1147 (path->waitingForRTTCalculaton ==
true) &&
1148 ((path->tsnForRTTCalculation == tsna) ||
1149 (
tsnLt(path->tsnForRTTCalculation, tsna))))
1152 path->waitingForRTTCalculaton =
false;
1156 EV_DETAIL <<
"Stale CumAck (" << tsna <<
" < " <<
state->
lastTsnAck <<
")"
1161 (path->waitingForRTTCalculaton ==
true))
1168 bool renewRTT =
false;
1169 if ((
tsnLt(path->tsnForRTTCalculation, tsna)) ||
1170 (path->tsnForRTTCalculation == tsna))
1175 else if ((numGaps > 0) &&
1176 ((path->tsnForRTTCalculation == sackGapList.getGapStop(
SctpGapList::GT_Any, numGaps - 1)) ||
1179 for (int32_t key = 0; key < numGaps; key++) {
1182 if ((path->tsnForRTTCalculation == lo) ||
1183 (path->tsnForRTTCalculation == hi) ||
1184 (
tsnLt(lo, path->tsnForRTTCalculation) &&
1185 tsnLt(path->tsnForRTTCalculation, hi)))
1194 rttEstimation = simTime() - path->txTimeForRTTCalculation;
1195 path->waitingForRTTCalculaton =
false;
1198 EV_DETAIL << simTime() <<
": SlowPathRTTUpdate from stale SACK - rtt="
1199 << rttEstimation <<
" from TSN "
1200 << path->tsnForRTTCalculation
1201 <<
" on path " << path->remoteAddress
1202 <<
" => RTO=" << path->pathRto << endl;
1215 EV_DETAIL <<
"numGaps=0 && tsna " << tsna
1218 while (i >= tsna + 1) {
1235 EV_INFO <<
"===== Handling GapAcks after CumTSNAck " << tsna <<
" =====" << endl;
1236 EV_INFO <<
"We got " << numGaps <<
" gap reports" << endl;
1240 EV_DETAIL <<
"Number of chunks in retransmissionQ: " << queuedChunks
1258 EV_INFO <<
"TSN " << i <<
" was found. It has been un-acked." << endl;
1264 EV_INFO <<
"TSN " << i <<
" not found in retransmissionQ" << endl;
1272 EV_INFO <<
"Looking for changes in gap reports" << endl;
1274 uint32_t lo1 = tsna;
1275 uint32_t tsnCheck = tsna + 1;
1276 for (int32_t key = 0; key < numGaps; key++) {
1281 for (uint32_t pos = lo1 + 1; pos <= lo - 1; pos++) {
1282 assert(tsnCheck == pos);
1287 assert(myChunkLastPath !=
nullptr);
1294 EV_INFO <<
"Examine TSNs between " << lo <<
" and " << hi << endl;
1295 for (uint32_t pos = lo; pos <= hi; pos++) {
1296 bool chunkFirstTime =
true;
1297 assert(tsnCheck == pos);
1303 assert(myChunkLastPath !=
nullptr);
1310 sackGapList.tsnIsNonRevokable(myChunk->tsn));
1314 if ((path->tsnForRTTCalculation == myChunk->tsn) &&
1315 (path->waitingForRTTCalculaton ==
true) &&
1318 (myChunk->getLastDestinationPath() == path))
1320 const simtime_t rttEstimation = simTime() - path->txTimeForRTTCalculation;
1321 path->waitingForRTTCalculaton =
false;
1324 EV << simTime() <<
": SlowPathRTTUpdate from gap report - rtt="
1325 << rttEstimation <<
" from TSN "
1326 << path->tsnForRTTCalculation
1327 <<
" on path " << path->remoteAddress
1328 <<
" => RTO=" << path->pathRto << endl;
1333 else if (sackGapList.tsnIsNonRevokable(pos)) {
1334 bool chunkFirstTime =
false;
1340 sackGapList.tsnIsNonRevokable(myChunk->tsn));
1351 for (int32_t key = 0; key < numGaps; key++) {
1353 for (uint32_t pos = lo + 1; pos <= hi - 1; pos++) {
1354 bool chunkFirstTime =
true;
1361 EV_INFO <<
"TSN " << pos <<
" not found in retransmissionQ" << endl;
1380 if (rttEstimation < SIMTIME_MAX) {
1381 EV_DETAIL << simTime() <<
": SACK: rtt=" << rttEstimation
1382 <<
", path=" << path->remoteAddress << endl;
1389 myPath->statisticsPathGapAckedChunksInLastSACK->record(myPath->gapAckedChunksInLastSACK);
1390 myPath->statisticsPathGapNRAckedChunksInLastSACK->record(myPath->gapNRAckedChunksInLastSACK);
1391 myPath->statisticsPathGapUnackedChunksInLastSACK->record(myPath->gapUnackedChunksInLastSACK);
1429 EV_INFO <<
"processSackArrived: arwnd=" << arwnd
1431 <<
" set peerWindowFull" << endl;
1453 EV_DEBUG <<
"Before ccUpdateBytesAcked: ";
1456 const L3Address& myPathId = myPath->remoteAddress;
1458 if (myPath->newPseudoCumAck) {
1459 myPath->vectorPathPseudoCumAck->record(myPath->pseudoCumAck);
1461 if (myPath->newRTXPseudoCumAck) {
1462 myPath->vectorPathRTXPseudoCumAck->record(myPath->rtxPseudoCumAck);
1464 if (myPath->newlyAckedBytes > 0) {
1467 bool advanceWindow = myPath->newPseudoCumAck || myPath->newRTXPseudoCumAck;
1470 advanceWindow = myPath->newPseudoCumAck || myPath->newRTXPseudoCumAck;
1473 advanceWindow = myPath->newPseudoCumAck;
1476 advanceWindow = myPath->newCumAck;
1479 EV_DETAIL << simTime() <<
":\tCC " << myPath->newlyAckedBytes
1480 <<
" newly acked on path " << myPathId <<
";"
1481 <<
"\tpath->newPseudoCumAck=" << ((myPath->newPseudoCumAck ==
true) ?
"true" :
"false")
1482 <<
"\tpath->newRTXPseudoCumAck=" << ((myPath->newRTXPseudoCumAck ==
true) ?
"true" :
"false")
1483 <<
"\tdropFilledGap=" << ((dropFilledGap ==
true) ?
"true" :
"false")
1484 <<
"\t->\tadvanceWindow=" << advanceWindow << endl;
1487 (advanceWindow && dropFilledGap) ? false :
1490 myPath->packetsInBurst = 0;
1496 EV_DEBUG <<
"Before ccUpdateAfterSack with tsna=" << tsna << endl;
1511 const SctpDataVariables *myChunk = iterator->second;
1514 if (myChunkLastPath->newOldestChunkSendTime > myChunk->sendTime) {
1515 EV_DETAIL <<
"TSN " << myChunk->tsn <<
" is new oldest on path "
1516 << myChunkLastPath->remoteAddress <<
", rel send time is "
1517 << simTime() - myChunk->sendTime <<
" ago" << endl;
1518 myChunkLastPath->newOldestChunkSendTime = myChunk->sendTime;
1519 myChunkLastPath->oldestChunkTsn = myChunk->tsn;
1528 const L3Address& myPathId = myPath->remoteAddress;
1531 bool updatedOldestChunkSendTime =
false;
1536 if (myPath->newOldestChunkSendTime > simTime()) {
1537 myPath->newOldestChunkSendTime = myPath->oldestChunkSendTime;
1541 else if (myPath->newOldestChunkSendTime != myPath->oldestChunkSendTime) {
1543 myPath->oldestChunkSendTime = myPath->newOldestChunkSendTime;
1544 updatedOldestChunkSendTime =
true;
1546 assert(myPath->oldestChunkSendTime <= simTime());
1548 if (myPath->outstandingBytes == 0) {
1553 myPath->oldestChunkSendTime = SIMTIME_ZERO;
1556 else if (myPath->newCumAck) {
1561 startTimer(myPath->T3_RtxTimer, myPath->pathRto);
1563 else if (updatedOldestChunkSendTime) {
1565 startTimer(myPath->T3_RtxTimer, myPath->pathRto);
1569 if (myPath->lowestTsnRetransmitted ==
true) {
1570 EV_INFO <<
"Lowest TSN retransmitted => restart of T3 timer for path "
1571 << myPathId << endl;
1573 startTimer(myPath->T3_RtxTimer, myPath->pathRto);
1578 if (myPath->newlyAckedBytes > 0) {
Referenced by process_RCV_Message().
◆ processSctpMessage()
Process incoming SCTP segment.
Normally returns true. A return value of false means that the connection structure must be deleted by the caller (SCTP).
982 if ((elem) == msgDestAddr) {
988 EV_INFO <<
"destAddr " << msgDestAddr <<
" is not bound to host\n";
Referenced by inet::sctp::Sctp::handleMessage().
◆ processSsnTsnResetRequestArrived()
◆ processStreamResetArrived()
2813 EV_INFO <<
"processStreamResetArrived\n";
2814 SctpParameter *parameter, *nextParam;
2815 std::map<uint32_t, SctpStateVariables::RequestData>::reverse_iterator rit;
2816 uint32_t numberOfParameters = resetChunk->getParametersArraySize();
2817 if (numberOfParameters == 0)
2819 for (uint16_t i = 0; i < numberOfParameters; i++) {
2820 parameter = (SctpParameter *)(resetChunk->getParameters(i));
2821 switch (parameter->getParameterType()) {
2823 SctpOutgoingSsnResetRequestParameter *outRequestParam;
2824 outRequestParam = check_and_cast<SctpOutgoingSsnResetRequestParameter *>(parameter);
2827 if (
state->
peerRequests[outRequestParam->getSrReqSn()].type != outRequestParam->getParameterType()) {
2832 std::map<uint32_t, SctpStateVariables::RequestData>::reverse_iterator rit;
2854 state->
peerRequests[outRequestParam->getSrReqSn()].sn = outRequestParam->getSrReqSn();
2856 state->
peerRequests[outRequestParam->getSrReqSn()].type = outRequestParam->getParameterType();
2857 if (numberOfParameters > i + 1u) {
2858 nextParam = (SctpParameter *)(resetChunk->getParameters(i + 1));
2866 switch (nextParam->getParameterType()) {
2868 SctpIncomingSsnResetRequestParameter *inRequestParam;
2869 inRequestParam = check_and_cast<SctpIncomingSsnResetRequestParameter *>(nextParam);
2870 state->
peerRequests[inRequestParam->getSrReqSn()].sn = inRequestParam->getSrReqSn();
2872 state->
peerRequests[inRequestParam->getSrReqSn()].type = inRequestParam->getParameterType();
2878 SctpStreamResetResponseParameter *responseParam;
2879 responseParam = check_and_cast<SctpStreamResetResponseParameter *>(nextParam);
2894 SctpIncomingSsnResetRequestParameter *inRequestParam;
2895 inRequestParam = check_and_cast<SctpIncomingSsnResetRequestParameter *>(parameter);
2903 (inRequestParam->getSrReqSn() != rit->first + 1)) ||
2913 if (inRequestParam->getStreamNumbersArraySize() > 0) {
2915 for (
uint i = 0; i < inRequestParam->getStreamNumbersArraySize(); i++) {
2916 std::list<uint16_t>::iterator it;
2918 if ((*it) == inRequestParam->getStreamNumbers(i))
2922 if (match == inRequestParam->getStreamNumbersArraySize()) {
2933 state->
peerRequests[inRequestParam->getSrReqSn()].sn = inRequestParam->getSrReqSn();
2935 state->
peerRequests[inRequestParam->getSrReqSn()].type = inRequestParam->getParameterType();
2936 if (numberOfParameters > i + 1u) {
2937 nextParam = (SctpParameter *)(resetChunk->getParameters(i + 1));
2944 SctpOutgoingSsnResetRequestParameter *outRequestParam;
2945 outRequestParam = check_and_cast<SctpOutgoingSsnResetRequestParameter *>(nextParam->dup());
2946 state->
peerRequests[outRequestParam->getSrReqSn()].sn = outRequestParam->getSrReqSn();
2948 state->
peerRequests[outRequestParam->getSrReqSn()].type = outRequestParam->getParameterType();
2950 delete outRequestParam;
2961 SctpSsnTsnResetRequestParameter *ssnRequestParam;
2962 ssnRequestParam = check_and_cast<SctpSsnTsnResetRequestParameter *>(parameter);
2974 ((((ssnRequestParam->getSrReqSn() < (
state->
peerRequestSn)) && (ssnRequestParam->getSrReqSn() != rit->first + 1))) ||
2976 state->
peerRequests[ssnRequestParam->getSrReqSn()].type != ssnRequestParam->getParameterType())))
2985 state->
peerRequests[ssnRequestParam->getSrReqSn()].sn = ssnRequestParam->getSrReqSn();
2987 state->
peerRequests[ssnRequestParam->getSrReqSn()].type = ssnRequestParam->getParameterType();
2992 SctpAddStreamsRequestParameter *addStreamsParam =
2993 check_and_cast<SctpAddStreamsRequestParameter *>(parameter);
2994 if (addStreamsParam->getNumberOfStreams() == 0) {
3001 (addStreamsParam->getSrReqSn() != rit->first + 1))) ||
3003 state->
peerRequests[addStreamsParam->getSrReqSn()].type != addStreamsParam->getParameterType()))
3008 if (!(addStreamsParam->getNumberOfStreams() +
outboundStreams <= 65535)) {
3012 state->
peerRequests[addStreamsParam->getSrReqSn()].sn = addStreamsParam->getSrReqSn();
3014 state->
peerRequests[addStreamsParam->getSrReqSn()].type = addStreamsParam->getParameterType();
3015 if (numberOfParameters > i + 1u) {
3016 nextParam = (SctpParameter *)(resetChunk->getParameters(i + 1));
3018 SctpAddStreamsRequestParameter *addOutStreamsParam;
3019 addOutStreamsParam = check_and_cast<SctpAddStreamsRequestParameter *>(nextParam);
3020 state->
peerRequests[addOutStreamsParam->getSrReqSn()].sn = addOutStreamsParam->getSrReqSn();
3022 state->
peerRequests[addOutStreamsParam->getSrReqSn()].type = addOutStreamsParam->getParameterType();
3039 SctpAddStreamsRequestParameter *addOutStreamsParam =
3040 check_and_cast<SctpAddStreamsRequestParameter *>(parameter);
3041 if (addOutStreamsParam->getNumberOfStreams() == 0) {
3046 if ((!(addOutStreamsParam->getNumberOfStreams() +
inboundStreams <= 65535)) ||
3054 if (
state->
peerRequests[addOutStreamsParam->getSrReqSn()].type != addOutStreamsParam->getParameterType()) {
3072 (addOutStreamsParam->getSrReqSn() != rit->first + 1))))
3078 state->
peerRequests[addOutStreamsParam->getSrReqSn()].sn = addOutStreamsParam->getSrReqSn();
3080 state->
peerRequests[addOutStreamsParam->getSrReqSn()].type = addOutStreamsParam->getParameterType();
3087 if (numberOfParameters > i + 1u) {
3088 nextParam = (SctpParameter *)(resetChunk->getParameters(i + 1));
3090 SctpAddStreamsRequestParameter *addInStreamsParam;
3091 addInStreamsParam = check_and_cast<SctpAddStreamsRequestParameter *>(nextParam);
3092 state->
peerRequests[addInStreamsParam->getSrReqSn()].sn = addInStreamsParam->getSrReqSn();
3094 state->
peerRequests[addInStreamsParam->getSrReqSn()].type = addInStreamsParam->getParameterType();
3121 SctpStreamResetResponseParameter *responseParam;
3122 responseParam = check_and_cast<SctpStreamResetResponseParameter *>(parameter);
3128 if (numberOfParameters > i + 1u) {
3129 nextParam = (SctpParameter *)(resetChunk->getParameters(i + 1));
3131 if (responseParam->getResult() !=
DEFERRED)
3136 switch (nextParam->getParameterType()) {
3138 SctpOutgoingSsnResetRequestParameter *outRequestParam;
3139 outRequestParam = check_and_cast<SctpOutgoingSsnResetRequestParameter *>(nextParam);
3147 state->
peerRequests[outRequestParam->getSrReqSn()].sn = outRequestParam->getSrReqSn();
3149 state->
peerRequests[outRequestParam->getSrReqSn()].type = outRequestParam->getParameterType();
3159 if (responseParam->getResult() !=
DEFERRED)
Referenced by process_RCV_Message().
◆ processTimer()
| bool inet::sctp::SctpAssociation::processTimer |
( |
cMessage * |
msg | ) |
|
879 EV_INFO << msg->getName() <<
" timer expired at " << simTime() <<
"\n";
881 SctpPathInfo *pinfo = check_and_cast<SctpPathInfo *>(msg->getControlInfo());
882 L3Address addr = pinfo->getRemoteAddress();
884 if (!addr.isUnspecified())
913 else if (path !=
nullptr && msg == path->HeartbeatIntervalTimer) {
916 else if (path !=
nullptr && msg == path->HeartbeatTimer) {
919 else if (path !=
nullptr && msg == path->T3_RtxTimer) {
922 else if (path !=
nullptr && msg == path->CwndTimer) {
925 else if (strcmp(msg->getName(),
"StartTesting") == 0) {
929 EV_DEBUG <<
"set testing to true\n";
933 else if (path !=
nullptr && msg == path->ResetTimer) {
936 else if (path !=
nullptr && msg == path->AsconfTimer) {
941 const char *
type =
sctpMain->par(
"addIpType").stringValue();
947 it->second.fairStart = simTime();
954 it->second.fairStop = simTime();
955 it->second.fairLifeTime = it->second.fairStop - it->second.fairStart;
956 it->second.fairThroughput = it->second.fairAckedBytes / it->second.fairLifeTime.dbl();
Referenced by inet::sctp::Sctp::handleMessage().
◆ pushUlp()
| void inet::sctp::SctpAssociation::pushUlp |
( |
| ) |
|
|
protected |
1962 bool restrict =
false;
1970 <<
" bytes queued) ..." << endl
1973 <<
" restrict=" << restrict
1976 uint64_t tempQueuedBytes = 0;
1979 SctpReceiveStream *rStream = iter->second;
1980 EV_DETAIL <<
"Size of stream " << iter->first <<
": "
1981 << rStream->getDeliveryQ()->getQueueSize() << endl;
1983 while ((!rStream->getDeliveryQ()->payloadQueue.empty()) &&
1986 SctpDataVariables *chunk = rStream->getDeliveryQ()->extractMessage();
2026 EV_DETAIL <<
"Push TSN " << chunk->tsn
2027 <<
": sid=" << chunk->sid <<
" ssn=" << chunk->ssn << endl;
2029 SctpSimpleMessage *smsg = check_and_cast<SctpSimpleMessage *>(chunk->userData);
2030 auto applicationPacket =
new Packet(
"ApplicationPacket",
SCTP_I_DATA);
2031 std::vector<uint8_t> vec;
2032 int sendBytes = smsg->getDataLen();
2033 vec.resize(sendBytes);
2034 for (
int i = 0; i < sendBytes; i++)
2035 vec[i] = smsg->getData(i);
2036 auto applicationData = makeShared<BytesChunk>();
2037 applicationData->setBytes(vec);
2038 applicationData->addTag<CreationTimeTag>()->setCreationTime(smsg->getCreationTime());
2039 auto& cmd = applicationPacket->addTag<SctpRcvReq>();
2042 cmd->setSid(chunk->sid);
2043 cmd->setSsn(chunk->ssn);
2044 cmd->setSendUnordered(!chunk->ordered);
2047 cmd->setPpid(chunk->ppid);
2048 cmd->setTsn(chunk->tsn);
2050 applicationPacket->insertAtBack(applicationData);
2054 if (iter->second.numEndToEndMessages >= iter->second.startEndToEndDelay &&
2055 (iter->second.numEndToEndMessages < iter->second.stopEndToEndDelay || !iter->second.stopEndToEndDelay))
2057 iter->second.cumEndToEndDelay += (simTime() - chunk->firstSendTime);
2059 iter->second.numEndToEndMessages++;
2062 chunk->userData->setTimestamp(chunk->firstSendTime);
2074 if (!(elem.second->getDeliveryQ()->payloadQueue.empty())) {
2081 EV_INFO <<
"SCTP_E_CLOSE" << endl;
Referenced by process_RECEIVE_REQUEST().
◆ putInDeliveryQ()
| void inet::sctp::SctpAssociation::putInDeliveryQ |
( |
uint16_t |
sid | ) |
|
|
protected |
1915 EV_INFO <<
"putInDeliveryQ: SSN=" << rStream->getExpectedStreamSeqNum()
1917 <<
" QueueSize=" << rStream->getOrderedQ()->getQueueSize() << endl;
1918 while (rStream->getOrderedQ()->getQueueSize() > 0) {
1920 SctpDataVariables *chunk =
1921 rStream->getOrderedQ()->dequeueChunkBySSN(rStream->getExpectedStreamSeqNum());
1923 EV_DETAIL <<
"putInDeliveryQ::chunk " << chunk->tsn
1924 <<
", sid " << chunk->sid <<
" and ssn " << chunk->ssn
1925 <<
" dequeued from ordered queue. queuedReceivedBytes="
1927 << chunk->len / 8 << endl;
1932 if (rStream->getDeliveryQ()->checkAndInsertChunk(chunk->tsn, chunk)) {
1936 EV_DETAIL <<
"data put in deliveryQ; queuedBytes now "
1939 int32_t seqnum = rStream->getExpectedStreamSeqNum();
1940 rStream->setExpectedStreamSeqNum(++seqnum);
1941 if (rStream->getExpectedStreamSeqNum() > 65535) {
1942 rStream->setExpectedStreamSeqNum(0);
Referenced by processDataArrived(), and pushUlp().
◆ putInTransmissionQ()
| void inet::sctp::SctpAssociation::putInTransmissionQ |
( |
uint32_t |
tsn, |
|
|
SctpDataVariables * |
chunk |
|
) |
| |
|
protected |
2953 if (chunk->countsAsOutstanding) {
2957 EV_DETAIL <<
"putInTransmissionQ: insert tsn=" << tsn << endl;
2958 chunk->wasDropped =
true;
2959 chunk->wasPktDropped =
true;
2960 chunk->hasBeenFastRetransmitted =
true;
2961 chunk->setNextDestination(chunk->getLastDestinationPath());
2963 EV_DETAIL <<
"putInTransmissionQ: cannot add message/chunk (TSN="
2964 << tsn <<
") to the transmissionQ" << endl;
2967 chunk->enqueuedInTransmissionQ =
true;
2971 qb->second += chunk->booksize;
2973 << q->second <<
" bytes" << endl;
Referenced by processPacketDropArrived().
◆ recalculateOLIABasis()
| void inet::sctp::SctpAssociation::recalculateOLIABasis |
( |
| ) |
|
|
private |
194 double assoc_best_paths_l_rXl_r__rtt_r = 0.0;
197 uint32_t max_w_paths = 0;
198 uint32_t max_w_paths_cnt = 0;
199 (void)max_w_paths_cnt;
200 uint32_t best_paths_cnt = 0;
207 for (SctpPathMap::iterator iter =
sctpPathMap.begin();
212 double r_sRTT = GET_SRTT(path->srtt.dbl());
213 double r_l_rXl_r__rtt_r = ((path->oliaSentBytes
214 * path->oliaSentBytes) / r_sRTT);
216 assoc_best_paths_l_rXl_r__rtt_r = r_l_rXl_r__rtt_r;
221 max_w_paths = path->cwnd;
228 if (r_l_rXl_r__rtt_r > assoc_best_paths_l_rXl_r__rtt_r) {
229 assoc_best_paths_l_rXl_r__rtt_r = r_l_rXl_r__rtt_r;
233 best_paths_cnt = cnt;
236 if (path->cwnd > max_w_paths) {
237 max_w_paths = path->cwnd;
240 max_w_paths_cnt = cnt;
Referenced by updateOLIA().
◆ receiveStreamPresent()
| bool inet::sctp::SctpAssociation::receiveStreamPresent |
( |
uint32_t |
sid | ) |
|
|
protected |
◆ recordCwndUpdate()
◆ removeFirstChunk()
| void inet::sctp::SctpAssociation::removeFirstChunk |
( |
SctpHeader * |
sctpmsg | ) |
|
|
protected |
2876 SctpChunk *chunk = sctpmsg->removeFirstChunk();
◆ removePath() [1/2]
| void inet::sctp::SctpAssociation::removePath |
( |
| ) |
|
1807 if ((*j) == path->remoteAddress) {
1812 EV_INFO << getFullPath() <<
" remove path " << path->remoteAddress << endl;
1814 delete path->HeartbeatTimer;
1815 stopTimer(path->HeartbeatIntervalTimer);
1816 delete path->HeartbeatIntervalTimer;
1818 delete path->T3_RtxTimer;
1820 delete path->CwndTimer;
1822 delete path->ResetTimer;
1824 delete path->AsconfTimer;
1826 delete path->BlockingTimer;
Referenced by processAsconfArrived(), and inet::sctp::Sctp::removeAssociation().
◆ removePath() [2/2]
| void inet::sctp::SctpAssociation::removePath |
( |
const L3Address & |
addr | ) |
|
2138 delete path->HeartbeatTimer;
2139 stopTimer(path->HeartbeatIntervalTimer);
2140 delete path->HeartbeatIntervalTimer;
2142 delete path->T3_RtxTimer;
2144 delete path->CwndTimer;
2147 delete path->ResetTimer;
2149 delete path->AsconfTimer;
◆ renegablyAckChunk()
1957 if (chunk->countsAsOutstanding) {
1961 if ((chunk->hasBeenCountedAsNewlyAcked ==
false) &&
1962 (chunk->hasBeenAcked ==
false))
1965 (chunk->hasBeenMoved ==
false))
1967 chunk->hasBeenCountedAsNewlyAcked =
true;
1970 chunk->getLastDestinationPath()->newlyAckedBytes += chunk->booksize;
1976 chunk->gapReports = 0;
1980 EV_INFO <<
"Found TSN " << chunk->tsn <<
" in transmissionQ -> remote it" << endl;
1982 chunk->enqueuedInTransmissionQ =
false;
1986 qb->second -= chunk->booksize;
Referenced by handleChunkReportedAsAcked().
◆ resetExpectedSsn()
| void inet::sctp::SctpAssociation::resetExpectedSsn |
( |
uint16_t |
id | ) |
|
|
protected |
◆ resetExpectedSsns()
| void inet::sctp::SctpAssociation::resetExpectedSsns |
( |
| ) |
|
|
protected |
◆ resetGapLists()
| void inet::sctp::SctpAssociation::resetGapLists |
( |
| ) |
|
|
protected |
◆ resetSsn()
| void inet::sctp::SctpAssociation::resetSsn |
( |
uint16_t |
id | ) |
|
|
protected |
◆ resetSsns()
| void inet::sctp::SctpAssociation::resetSsns |
( |
| ) |
|
|
protected |
◆ retransmitAsconf()
| void inet::sctp::SctpAssociation::retransmitAsconf |
( |
| ) |
|
|
protected |
160 const auto& sctpmsg = makeShared<SctpHeader>();
163 SctpAsconfChunk *sctpasconf =
new SctpAsconfChunk();
165 sctpasconf->setSctpChunkType(
ASCONF);
170 sctpmsg->appendSctpChunks(authChunk);
172 it->second.numAuthChunksSent++;
174 sctpmsg->appendSctpChunks(sctpasconf);
175 Packet *pkt =
new Packet(
"ASCONF");
Referenced by process_TIMEOUT_ASCONF(), and processPacketDropArrived().
◆ retransmitCookieEcho()
| void inet::sctp::SctpAssociation::retransmitCookieEcho |
( |
| ) |
|
|
protected |
1004 SctpAuthenticationChunk *authChunk;
1005 const auto& sctpmsg = makeShared<SctpHeader>();
1007 SctpCookieEchoChunk *cookieEchoChunk = check_and_cast<SctpCookieEchoChunk *>(
state->
cookieChunk->
dup());
1008 if (cookieEchoChunk->getCookieArraySize() == 0) {
1013 sctpmsg->appendSctpChunks(authChunk);
1015 it->second.numAuthChunksSent++;
1017 sctpmsg->appendSctpChunks(cookieEchoChunk);
1019 EV_INFO <<
"retransmitCookieEcho localAddr=" <<
localAddr <<
" remoteAddr" <<
remoteAddr <<
"\n";
1020 Packet *fp =
new Packet(
"COOKIE-ECHO RTX");
Referenced by process_TIMEOUT_INIT_REXMIT(), and processPacketDropArrived().
◆ retransmitInit()
| void inet::sctp::SctpAssociation::retransmitInit |
( |
| ) |
|
|
protected |
Retransmitting chunks.
758 const auto& sctpmsg = makeShared<SctpHeader>();
760 SctpInitChunk *sctpinit;
762 EV_INFO <<
"Retransmit InitChunk=" << &sctpinit <<
"\n";
765 sctpinit->setSctpChunkType(
INIT);
766 sctpmsg->appendSctpChunks(sctpinit);
768 Packet *fp =
new Packet(
"INIT RTX");
Referenced by process_TIMEOUT_INIT_REXMIT(), and processPacketDropArrived().
◆ retransmitReset()
| void inet::sctp::SctpAssociation::retransmitReset |
( |
| ) |
|
|
protected |
18 const auto& sctpmsg = makeShared<SctpHeader>();
20 SctpStreamResetChunk *sctpreset = check_and_cast<SctpStreamResetChunk *>(
state->
resetChunk->
dup());
23 sctpmsg->appendSctpChunks(sctpreset);
25 EV_INFO <<
"retransmitStreamReset localAddr=" <<
localAddr <<
" remoteAddr" <<
remoteAddr <<
"\n";
26 Packet *pkt =
new Packet(
"RE_CONFIG");
Referenced by process_TIMEOUT_RESET().
◆ retransmitShutdown()
| void inet::sctp::SctpAssociation::retransmitShutdown |
( |
| ) |
|
|
protected |
1217 const auto& sctpmsg = makeShared<SctpHeader>();
1219 SctpShutdownChunk *shutdownChunk;
1221 sctpmsg->appendSctpChunks(shutdownChunk);
1223 EV_INFO <<
"retransmitShutdown localAddr=" <<
localAddr <<
" remoteAddr" <<
remoteAddr <<
"\n";
1225 Packet *fp =
new Packet(
"SHUTDOWN RTX");
Referenced by process_TIMEOUT_SHUTDOWN(), and processPacketDropArrived().
◆ retransmitShutdownAck()
| void inet::sctp::SctpAssociation::retransmitShutdownAck |
( |
| ) |
|
|
protected |
1231 const auto& sctpmsg = makeShared<SctpHeader>();
1233 SctpShutdownAckChunk *shutdownAckChunk;
1235 sctpmsg->appendSctpChunks(shutdownAckChunk);
1237 EV_INFO <<
"retransmitShutdownAck localAddr=" <<
localAddr <<
" remoteAddr" <<
remoteAddr <<
"\n";
1239 Packet *fp =
new Packet(
"SHUTDOWN-ACK RTX");
Referenced by process_TIMEOUT_SHUTDOWN(), and processPacketDropArrived().
◆ rpPathBlockingControl()
| int32_t inet::sctp::SctpAssociation::rpPathBlockingControl |
( |
SctpPathVariables * |
path, |
|
|
double |
reduction |
|
) |
| |
|
protected |
413 const int32_t newCwnd = (int32_t)ceil(path->cwnd - reduction);
417 if ((path->blockingTimeout < 0.0) || (path->blockingTimeout < simTime())) {
421 path->cmtGroupPaths * path->pathRto :
423 EV <<
"Blocking " << path->remoteAddress <<
" for " << timeout << endl;
425 path->blockingTimeout = simTime() + timeout;
426 assert(!path->BlockingTimer->isScheduled());
Referenced by cwndUpdateAfterSack().
◆ scheduleSack()
| void inet::sctp::SctpAssociation::scheduleSack |
( |
| ) |
|
|
protected |
1334 EV_DETAIL <<
"scheduleSack() : ackState is now: " <<
state->
ackState <<
"\n";
1344 EV_DETAIL <<
"SACK timer running, but scheduleSack() called\n";
Referenced by process_RCV_Message().
◆ scheduleTimeout()
| void inet::sctp::SctpAssociation::scheduleTimeout |
( |
cMessage * |
msg, |
|
|
const simtime_t & |
timeout |
|
) |
| |
|
inlineprotected |
◆ SCTP_UINT16_GE()
| static bool inet::sctp::SctpAssociation::SCTP_UINT16_GE |
( |
uint16_t |
a, |
|
|
uint16_t |
b |
|
) |
| |
|
inlinestatic |
◆ SCTP_UINT16_GT()
| static bool inet::sctp::SctpAssociation::SCTP_UINT16_GT |
( |
uint16_t |
a, |
|
|
uint16_t |
b |
|
) |
| |
|
inlinestatic |
Compare TSNs.
1060 return ((a <
b) && ((uint16_t)(
b - a) > (1U << 15))) || \
1061 ((a >
b) && ((uint16_t)(a -
b) < (1U << 15)));
◆ SCTP_UINT32_GE()
| static bool inet::sctp::SctpAssociation::SCTP_UINT32_GE |
( |
uint32_t |
a, |
|
|
uint32_t |
b |
|
) |
| |
|
inlinestatic |
◆ SCTP_UINT32_GT()
| static bool inet::sctp::SctpAssociation::SCTP_UINT32_GT |
( |
uint32_t |
a, |
|
|
uint32_t |
b |
|
) |
| |
|
inlinestatic |
1066 return ((a <
b) && ((uint32_t)(
b - a) > (1UL << 31))) ||
1067 ((a >
b) && ((uint32_t)(a -
b) < (1UL << 31)));
◆ sendAbort()
| void inet::sctp::SctpAssociation::sendAbort |
( |
uint16_t |
tBit = 0 | ) |
|
|
protected |
1155 SctpAuthenticationChunk *authChunk;
1156 const auto& msg = makeShared<SctpHeader>();
1159 EV_INFO <<
"SctpAssociationUtil:sendABORT localPort=" <<
localPort <<
" remotePort=" <<
remotePort <<
"\n";
1163 SctpAbortChunk *abortChunk =
new SctpAbortChunk();
1164 abortChunk->setSctpChunkType(
ABORT);
1165 abortChunk->setT_Bit(tBit);
1169 msg->appendSctpChunks(authChunk);
1171 it->second.numAuthChunksSent++;
1173 msg->appendSctpChunks(abortChunk);
1177 Packet *fp =
new Packet(
"ABORT");
Referenced by process_ABORT(), process_RCV_Message(), process_TIMEOUT_HEARTBEAT(), process_TIMEOUT_INIT_REXMIT(), process_TIMEOUT_RTX(), process_TIMEOUT_SHUTDOWN(), processCookieEchoArrived(), processErrorArrived(), processInitArrived(), processTimer(), and updateCounters().
◆ sendAddInAndOutStreamsRequest()
| void inet::sctp::SctpAssociation::sendAddInAndOutStreamsRequest |
( |
SctpResetReq * |
info | ) |
|
|
protected |
699 EV_INFO <<
"StreamReset:sendAddInandStreamsRequest\n";
700 const auto& msg = makeShared<SctpHeader>();
704 SctpResetTimer *
rt =
new SctpResetTimer();
705 SctpStreamResetChunk *resetChunk =
new SctpStreamResetChunk();
709 SctpAddStreamsRequestParameter *
addOutStreams =
new SctpAddStreamsRequestParameter();
714 rt->setOutAcked(
false);
720 SctpAddStreamsRequestParameter *
addInStreams =
new SctpAddStreamsRequestParameter();
725 rt->setInAcked(
false);
739 state->
resetChunk = check_and_cast<SctpStreamResetChunk *>(resetChunk->dup());
741 msg->appendSctpChunks(resetChunk);
742 Packet *pkt =
new Packet(
"RE_CONFIG");
Referenced by process_STREAM_RESET().
◆ sendAddOutgoingStreamsRequest()
| void inet::sctp::SctpAssociation::sendAddOutgoingStreamsRequest |
( |
uint16_t |
numStreams | ) |
|
|
protected |
647 EV_INFO <<
"StreamReset:sendAddOutgoingStreamsRequest\n";
649 const auto& msg = makeShared<SctpHeader>();
653 SctpStreamResetChunk *resetChunk =
new SctpStreamResetChunk();
666 it->second.numResetRequestsSent++;
668 SctpAddStreamsRequestParameter *addStreams =
new SctpAddStreamsRequestParameter();
670 addStreams->setNumberOfStreams(numStreams);
673 addStreams->setSrReqSn(srsn);
675 resetChunk->addParameter(addStreams);
680 state->
resetChunk = check_and_cast<SctpStreamResetChunk *>(resetChunk->dup());
682 msg->appendSctpChunks(resetChunk);
683 Packet *pkt =
new Packet(
"RE_CONFIG");
686 SctpResetTimer *
rt =
new SctpResetTimer();
688 rt->setInAcked(
true);
690 rt->setOutAcked(
false);
Referenced by process_RCV_Message().
◆ sendAsconf()
| void inet::sctp::SctpAssociation::sendAsconf |
( |
const char * |
type, |
|
|
bool |
remote = false |
|
) |
| |
|
protected |
Methods for Add-IP and AUTH.
17 SctpAuthenticationChunk *authChunk =
nullptr;
20 uint16_t chunkLength = 0;
23 EV_DEBUG <<
"sendAsconf\n";
24 const auto& sctpAsconf = makeShared<SctpHeader>();
28 SctpAsconfChunk *asconfChunk =
new SctpAsconfChunk();
29 asconfChunk->setSctpChunkType(
ASCONF);
34 asconfChunk->setAddressParam(L3Address(
"0.0.0.0"));
49 throw cRuntimeError(
"Unknown address type");
51 asconfChunk->setByteLength(chunkLength);
53 cStringTokenizer tokenizer(
type);
54 while (tokenizer.hasMoreTokens()) {
55 const char *token = tokenizer.nextToken();
56 switch (atoi(token)) {
58 SctpAddIPParameter *ipParam;
59 ipParam =
new SctpAddIPParameter();
64 ipParam->setAddressParam(L3Address(
"0.0.0.0"));
73 ipParam->setAddressParam(L3AddressResolver().resolve(
sctpMain->par(
"addAddress"), 1));
84 throw cRuntimeError(
"Unknown address type");
85 asconfChunk->addAsconfParam(ipParam);
90 SctpDeleteIPParameter *delParam;
91 delParam =
new SctpDeleteIPParameter();
95 delParam->setAddressParam(L3AddressResolver().resolve(
sctpMain->par(
"addAddress"), 1));
105 throw cRuntimeError(
"Unknown address type");
106 asconfChunk->addAsconfParam(delParam);
111 SctpSetPrimaryIPParameter *priParam;
112 priParam =
new SctpSetPrimaryIPParameter();
116 priParam->setAddressParam(L3AddressResolver().resolve(
sctpMain->par(
"addAddress"), 1));
118 priParam->setAddressParam(L3Address(
"0.0.0.0"));
129 throw cRuntimeError(
"Unknown address type");
130 asconfChunk->addAsconfParam(priParam);
135 EV_INFO <<
"type " << atoi(token) <<
"not known\n";
139 asconfChunk->setByteLength(chunkLength);
143 sctpAsconf->appendSctpChunks(authChunk);
145 it->second.numAuthChunksSent++;
147 sctpAsconf->appendSctpChunks(asconfChunk);
152 Packet *pkt =
new Packet(
"ASCONF");
153 sendToIP(pkt, sctpAsconf, targetAddr);
Referenced by processAppCommand(), processAsconfArrived(), processErrorArrived(), and processTimer().
◆ sendAsconfAck()
| void inet::sctp::SctpAssociation::sendAsconfAck |
( |
uint32_t |
serialNumber | ) |
|
|
protected |
181 const auto& sctpAsconfAck = makeShared<SctpHeader>();
186 SctpAsconfAckChunk *asconfAckChunk =
new SctpAsconfAckChunk();
188 asconfAckChunk->setSerialNumber(serialNumber);
192 sctpAsconfAck->appendSctpChunks(authChunk);
194 it->second.numAuthChunksSent++;
196 sctpAsconfAck->appendSctpChunks(asconfAckChunk);
197 Packet *pkt =
new Packet(
"ASCONF");
◆ sendAvailableIndicationToApp()
| void inet::sctp::SctpAssociation::sendAvailableIndicationToApp |
( |
| ) |
|
|
protected |
454 EV_INFO <<
"sendAvailableIndicationToApp: localPort="
459 auto availableIndication = msg->addTag<SctpAvailableReq>();
462 availableIndication->setLocalAddr(
localAddr);
463 availableIndication->setRemoteAddr(
remoteAddr);
464 availableIndication->setLocalPort(
localPort);
465 availableIndication->setRemotePort(
remotePort);
466 availableIndication->setNewSocketId(
assocId);
Referenced by stateEntered().
◆ sendBundledOutgoingResetAndResponse()
230 EV_INFO <<
"sendBundledOutgoingResetAndResponse to " <<
remoteAddr <<
"\n";
233 SctpStreamResetChunk *resetChunk =
new SctpStreamResetChunk();
237 SctpOutgoingSsnResetRequestParameter *outResetParam;
238 outResetParam =
new SctpOutgoingSsnResetRequestParameter();
243 outResetParam->setSrReqSn(srsn++);
244 outResetParam->setSrResSn(requestParam->getSrReqSn());
250 outResetParam->setStreamNumbers(i, *it);
252 resetSsn(outResetParam->getStreamNumbers(i));
258 else if (requestParam->getStreamNumbersArraySize() > 0) {
259 outResetParam->setStreamNumbersArraySize(requestParam->getStreamNumbersArraySize());
260 for (uint16_t i = 0; i < requestParam->getStreamNumbersArraySize(); i++) {
261 outResetParam->setStreamNumbers(i, requestParam->getStreamNumbers(i));
263 len = requestParam->getStreamNumbersArraySize() * 2;
266 resetChunk->addParameter(outResetParam);
269 SctpStreamResetChunk *resetResponseChunk;
270 EV_INFO <<
"sendbundledStreamResetResponse to " <<
remoteAddr <<
"\n";
271 resetResponseChunk =
new SctpStreamResetChunk();
272 resetResponseChunk->setSctpChunkType(
RE_CONFIG);
274 SctpStreamResetResponseParameter *responseParam =
new SctpStreamResetResponseParameter();
276 responseParam->setSrResSn(requestParam->getSrReqSn());
279 resetResponseChunk->addParameter(responseParam);
282 SctpResetTimer *
rt =
new SctpResetTimer();
284 rt->setInAcked(
true);
285 rt->setOutSN(srsn - 1);
286 rt->setOutAcked(
false);
288 const auto& msg = makeShared<SctpHeader>();
292 msg->appendSctpChunks(resetChunk);
293 msg->appendSctpChunks(resetResponseChunk);
299 state->
resetChunk = check_and_cast<SctpStreamResetChunk *>(resetChunk->dup());
308 Packet *pkt =
new Packet(
"RE_CONFIG");
◆ sendCookieAck()
| void inet::sctp::SctpAssociation::sendCookieAck |
( |
const L3Address & |
dest | ) |
|
|
protected |
1085 SctpAuthenticationChunk *authChunk;
1086 const auto& sctpcookieack = makeShared<SctpHeader>();
1089 EV_INFO <<
"SctpAssociationUtil:sendCookieACK\n";
1093 SctpCookieAckChunk *cookieAckChunk =
new SctpCookieAckChunk();
1094 cookieAckChunk->setSctpChunkType(
COOKIE_ACK);
1098 sctpcookieack->appendSctpChunks(authChunk);
1100 it->second.numAuthChunksSent++;
1102 sctpcookieack->appendSctpChunks(cookieAckChunk);
1103 Packet *fp =
new Packet(
"COOKIE-ACK");
Referenced by processCookieEchoArrived(), and processPacketDropArrived().
◆ sendCookieEcho()
| void inet::sctp::SctpAssociation::sendCookieEcho |
( |
SctpInitAckChunk * |
initackchunk | ) |
|
|
protected |
954 SctpAuthenticationChunk *authChunk;
955 const auto& sctpcookieecho = makeShared<SctpHeader>();
958 EV_INFO <<
"SctpAssociationUtil:sendCookieEcho\n";
962 SctpCookieEchoChunk *cookieEchoChunk =
new SctpCookieEchoChunk();
964 int32_t len = initAckChunk->getCookieArraySize();
965 cookieEchoChunk->setCookieArraySize(len);
967 for (int32_t i = 0; i < len; i++)
968 cookieEchoChunk->setCookie(i, initAckChunk->getCookie(i));
972 SctpCookie *cookie = (SctpCookie *)(initAckChunk->getStateCookie());
973 cookieEchoChunk->setStateCookie(cookie);
976 uint32_t unknownLen = initAckChunk->getUnrecognizedParametersArraySize();
977 if (unknownLen > 0) {
978 EV_INFO <<
"Found unrecognized Parameters in INIT-ACK chunk with a length of " << unknownLen <<
" bytes.\n";
979 cookieEchoChunk->setUnrecognizedParametersArraySize(unknownLen);
980 for (uint32_t i = 0; i < unknownLen; i++)
981 cookieEchoChunk->setUnrecognizedParameters(i, initAckChunk->getUnrecognizedParameters(i));
984 cookieEchoChunk->setUnrecognizedParametersArraySize(0);
985 state->
cookieChunk = check_and_cast<SctpCookieEchoChunk *>(cookieEchoChunk->dup());
992 sctpcookieecho->appendSctpChunks(authChunk);
994 it->second.numAuthChunksSent++;
997 sctpcookieecho->appendSctpChunks(cookieEchoChunk);
998 Packet *fp =
new Packet(
"COOKIE-ECHO");
Referenced by processInitAckArrived().
◆ sendDataArrivedNotification()
| void inet::sctp::SctpAssociation::sendDataArrivedNotification |
( |
uint16_t |
sid | ) |
|
|
protected |
◆ sendDoubleStreamResetResponse()
| void inet::sctp::SctpAssociation::sendDoubleStreamResetResponse |
( |
uint32_t |
insrrsn, |
|
|
uint16_t |
inresult, |
|
|
uint32_t |
outsrrsn, |
|
|
uint16_t |
outresult |
|
) |
| |
|
protected |
844 SctpStreamResetChunk *resetChunk;
845 EV_INFO <<
"sendDoubleStreamResetResponse to " <<
remoteAddr <<
"\n";
846 const auto& msg = makeShared<SctpHeader>();
850 resetChunk =
new SctpStreamResetChunk();
853 SctpStreamResetResponseParameter *outResponseParam =
new SctpStreamResetResponseParameter();
855 outResponseParam->setSrResSn(outsrrsn);
856 outResponseParam->setResult(outresult);
858 resetChunk->addParameter(outResponseParam);
859 SctpStreamResetResponseParameter *inResponseParam =
new SctpStreamResetResponseParameter();
861 inResponseParam->setSrResSn(insrrsn);
862 inResponseParam->setResult(inresult);
866 resetChunk->addParameter(inResponseParam);
867 msg->appendSctpChunks(resetChunk);
875 Packet *pkt =
new Packet(
"RE_CONFIG");
Referenced by processInAndOutResetRequestArrived().
◆ sendEstabIndicationToApp()
| void inet::sctp::SctpAssociation::sendEstabIndicationToApp |
( |
| ) |
|
|
protected |
Utility: sends SCTP_I_ESTABLISHED indication with SctpConnectInfo to application.
474 EV_INFO <<
"sendEstabIndicationToApp: localPort="
479 auto establishIndication = msg->addTag<SctpConnectReq>();
481 establishIndication->setSocketId(
assocId);
482 establishIndication->setLocalAddr(
localAddr);
483 establishIndication->setRemoteAddr(
remoteAddr);
484 establishIndication->setLocalPort(
localPort);
485 establishIndication->setRemotePort(
remotePort);
490 msg->addTag<SocketInd>()->setSocketId(
assocId);
494 char vectorName[128];
496 snprintf(vectorName,
sizeof(vectorName),
"Stream %d Throughput", i);
Referenced by processAppCommand(), and stateEntered().
◆ sendHeartbeat()
1026 SctpAuthenticationChunk *authChunk;
1027 const auto& sctpHeartbeatbeat = makeShared<SctpHeader>();
1030 sctpHeartbeatbeat->setSrcPort(
localPort);
1032 SctpHeartbeatChunk *heartbeatChunk =
new SctpHeartbeatChunk();
1033 heartbeatChunk->setSctpChunkType(
HEARTBEAT);
1034 heartbeatChunk->setRemoteAddr(path->remoteAddress);
1035 heartbeatChunk->setTimeField(simTime());
1039 sctpHeartbeatbeat->appendSctpChunks(authChunk);
1041 it->second.numAuthChunksSent++;
1043 sctpHeartbeatbeat->appendSctpChunks(heartbeatChunk);
1044 EV_INFO <<
"sendHeartbeat: sendToIP to " << path->remoteAddress << endl;
1045 Packet *fp =
new Packet(
"HEARTBEAT");
1046 sendToIP(fp, sctpHeartbeatbeat, path->remoteAddress);
Referenced by pmStartPathManagement(), process_TIMEOUT_HEARTBEAT_INTERVAL(), processAsconfArrived(), and processPacketDropArrived().
◆ sendHeartbeatAck()
1053 SctpAuthenticationChunk *authChunk;
1054 const auto& sctpHeartbeatAck = makeShared<SctpHeader>();
1056 sctpHeartbeatAck->setSrcPort(
localPort);
1058 SctpHeartbeatAckChunk *heartbeatAckChunk =
new SctpHeartbeatAckChunk();
1060 heartbeatAckChunk->setRemoteAddr(heartbeatChunk->getRemoteAddr());
1061 heartbeatAckChunk->setTimeField(heartbeatChunk->getTimeField());
1062 const int32_t len = heartbeatChunk->getInfoArraySize();
1064 heartbeatAckChunk->setInfoArraySize(len);
1065 for (int32_t i = 0; i < len; i++)
1066 heartbeatAckChunk->setInfo(i, heartbeatChunk->getInfo(i));
1069 heartbeatAckChunk->setByteLength(heartbeatChunk->getByteLength());
1072 sctpHeartbeatAck->appendSctpChunks(authChunk);
1074 it->second.numAuthChunksSent++;
1076 sctpHeartbeatAck->appendSctpChunks(heartbeatAckChunk);
1078 EV_INFO <<
"sendHeartbeatAck: sendToIP from " << src <<
" to " << dest << endl;
1079 Packet *fp =
new Packet(
"HEARTBEAT-ACK");
1080 sendToIP(fp, sctpHeartbeatAck, dest);
Referenced by process_RCV_Message().
◆ sendHMacError()
| void inet::sctp::SctpAssociation::sendHMacError |
( |
const uint16_t |
id | ) |
|
|
protected |
1899 const auto& sctpmsg = makeShared<SctpHeader>();
1901 SctpErrorChunk *errorChunk =
new SctpErrorChunk();
1902 errorChunk->setSctpChunkType(
ERRORTYPE);
1903 SctpSimpleErrorCauseParameter *cause =
new SctpSimpleErrorCauseParameter();
1905 cause->setByteLength(6);
1906 cause->setValue(
id);
1907 errorChunk->setByteLength(4);
1908 errorChunk->addParameters(cause);
1909 sctpmsg->appendSctpChunks(errorChunk);
Referenced by process_RCV_Message().
◆ sendIndicationToApp()
| void inet::sctp::SctpAssociation::sendIndicationToApp |
( |
int32_t |
code, |
|
|
int32_t |
value = 0 |
|
) |
| |
|
protected |
Utility: sends status indication (SCTP_I_xxx) to application.
437 EV_INFO <<
"sendIndicationToApp: " <<
indicationName(code) << endl;
442 auto& indication = msg->addTag<SctpCommandReq>();
443 indication->setSocketId(
assocId);
448 msg->addTag<SocketInd>()->setSocketId(
assocId);
Referenced by chunkMustBeAbandoned(), peekAbandonedChunk(), process_RCV_Message(), process_SEND(), process_TIMEOUT_HEARTBEAT(), process_TIMEOUT_INIT_REXMIT(), process_TIMEOUT_RTX(), process_TIMEOUT_SHUTDOWN(), processAsconfAckArrived(), processAsconfArrived(), processOutAndResponseArrived(), processResetResponseArrived(), processTimer(), resetExpectedSsn(), resetExpectedSsns(), resetSsns(), sendOnPath(), signalConnectionTimeout(), stateEntered(), and updateCounters().
◆ sendInit()
| void inet::sctp::SctpAssociation::sendInit |
( |
| ) |
|
|
protected |
Methods for creating and sending chunks.
560 throw cRuntimeError(
"Error processing command ASSOCIATE: foreign socket unspecified");
563 throw cRuntimeError(
"Error processing command ASSOCIATE: local port unspecified");
567 const auto& sctpmsg = makeShared<SctpHeader>();
569 SctpInitChunk *initChunk =
new SctpInitChunk();
570 initChunk->setSctpChunkType(
INIT);
571 initChunk->setInitTag((uint32_t)(fmod(
RNGCONTEXT intrand(INT32_MAX), 1.0 + (
double)(
unsigned)0xffffffffUL)) & 0xffffffffUL);
575 initChunk->setA_rwnd(
sctpMain->par(
"arwnd"));
580 initChunk->setInitTsn(1000);
581 initChunk->setMsg_rwnd(
sctpMain->par(
"messageAcceptLimit"));
587 initTsn = initChunk->getInitTsn();
588 #ifdef INET_WITH_IPv4
589 initChunk->setIpv4Supported(
true);
591 initChunk->setIpv4Supported(
false);
593 #ifdef INET_WITH_IPv6
594 initChunk->setIpv6Supported(
true);
596 initChunk->setIpv6Supported(
false);
600 #ifdef INET_WITH_IPv4
602 adv.push_back(ipv4Data->getIPAddress());
605 #endif // ifdef INET_WITH_IPv4
606 #ifdef INET_WITH_IPv6
608 for (int32_t j = 0; j < ipv6Data->getNumAddresses(); j++) {
609 EV_DETAIL <<
"add address " << ipv6Data->getAddress(j) <<
"\n";
610 adv.push_back(ipv6Data->getAddress(j));
614 #endif // ifdef INET_WITH_IPv6
620 EV_DETAIL <<
"gebundene Adresse " <<
localAddr <<
" wird hinzugefuegt\n";
622 if (initChunk->getIpv4Supported() || initChunk->getIpv6Supported()) {
625 uint32_t addrNum = 0;
626 bool friendly =
false;
627 if (
sctpMain->hasPar(
"natFriendly")) {
628 friendly =
sctpMain->par(
"natFriendly");
631 for (
auto& elem : adv) {
633 initChunk->setAddressesArraySize(addrNum + 1);
634 initChunk->setAddresses(addrNum++, (elem));
645 EV_DETAIL <<
"level of remote address=" << rlevel <<
"\n";
646 for (
auto& elem : adv) {
648 EV_DETAIL <<
"level of address " << (elem) <<
" = " << addressLevel <<
"\n";
649 if (addressLevel >= rlevel) {
650 initChunk->setAddressesArraySize(addrNum + 1);
651 initChunk->setAddresses(addrNum++, (elem));
658 else if (rlevel == 4 && addressLevel == 3 && friendly) {
671 initChunk->setSepChunksArraySize(++
count);
672 initChunk->setSepChunks(
count - 1,
AUTH);
675 for (int32_t
k = 0;
k < 32;
k++) {
676 initChunk->setRandomArraySize(
k + 1);
677 initChunk->setRandom(
k, (uint8_t)(
RNGCONTEXT intrand(256)));
688 initChunk->setSctpChunkTypes(
k, (elem));
699 initChunk->setHmacTypesArraySize(1);
700 initChunk->setHmacTypes(0, 1);
701 length += initChunk->getSctpChunkTypesArraySize() + 50;
704 initChunk->setSepChunksArraySize(++
count);
708 initChunk->setSepChunksArraySize(++
count);
711 if (
sctpMain->par(
"addIP").boolValue()) {
712 initChunk->setSepChunksArraySize(++
count);
714 initChunk->setSepChunksArraySize(++
count);
721 initChunk->setForwardTsn(
true);
725 initChunk->setByteLength(length);
726 sctpmsg->appendSctpChunks(initChunk);
730 EV_DEBUG <<
" get new path for " << (elem) <<
" at line " << __LINE__ <<
"\n";
739 EV_DEBUG <<
" get new path for " <<
remoteAddr <<
" at line " << __LINE__ <<
"\n";
747 state->
initChunk = check_and_cast<SctpInitChunk *>(initChunk->dup());
749 EV_INFO << getFullPath() <<
" sendInit: localVTag=" <<
localVTag <<
" peerVTag=" <<
peerVTag <<
"\n";
750 Packet *fp =
new Packet(
"INIT");
751 EV_INFO <<
"Length sctpmsg " <<
B(sctpmsg->getChunkLength()).get() << endl;
Referenced by process_ASSOCIATE().
◆ sendInitAck()
| void inet::sctp::SctpAssociation::sendInitAck |
( |
SctpInitChunk * |
initchunk | ) |
|
|
protected |
778 const auto& sctpinitack = makeShared<SctpHeader>();
783 EV_INFO <<
"sendInitAck at " <<
localAddr <<
". Provided InitTag=" << initChunk->getInitTag() <<
"\n";
784 SctpInitAckChunk *initAckChunk =
new SctpInitAckChunk();
785 initAckChunk->setSctpChunkType(
INIT_ACK);
786 SctpCookie *cookie =
new SctpCookie();
787 cookie->setCreationTime(simTime());
788 cookie->setLocalTieTagArraySize(32);
789 cookie->setPeerTieTagArraySize(32);
795 initAckChunk->setInitTsn(2000);
802 for (int32_t i = 0; i < 32; i++) {
803 cookie->setLocalTieTag(i, 0);
804 cookie->setPeerTieTag(i, 0);
807 EV_INFO <<
"state=closed: localVTag=" <<
localVTag <<
" peerVTag=" <<
peerVTag <<
"\n";
811 EV_INFO <<
"different state:set InitTag in InitAck: " << initAckChunk->getInitTag() <<
"\n";
815 cookie->setLocalTag(initChunk->getInitTag());
817 for (int32_t i = 0; i < 32; i++) {
818 cookie->setPeerTieTag(i, (uint8_t)(
RNGCONTEXT intrand(256)));
821 cookie->setLocalTieTag(i, (uint8_t)(
RNGCONTEXT intrand(256)));
825 cookie->setLocalTieTag(i, 0);
827 sctpinitack->setVTag(initChunk->getInitTag());
828 EV_DETAIL <<
"VTag in InitAck: " << sctpinitack->getVTag() <<
"\n";
831 EV_INFO <<
"other state\n";
834 tag = (uint32_t)(fmod(
RNGCONTEXT intrand(INT32_MAX), 1.0 + (double)(
unsigned)0xffffffffUL)) & 0xffffffffUL;
836 initAckChunk->setInitTag(tag);
840 for (int32_t i = 0; i < 32; i++) {
844 sctpinitack->setVTag(initChunk->getInitTag());
847 initAckChunk->setStateCookie(cookie);
848 initAckChunk->setCookieArraySize(0);
849 initAckChunk->setA_rwnd(
sctpMain->par(
"arwnd"));
851 initAckChunk->setMsg_rwnd(
sctpMain->par(
"messageAcceptLimit"));
852 initAckChunk->setNoOutStreams((
unsigned int)
min(
outboundStreams, initChunk->getNoInStreams()));
853 initAckChunk->setNoInStreams((
unsigned int)
min(
inboundStreams, initChunk->getNoOutStreams()));
854 initTsn = initAckChunk->getInitTsn();
855 #ifdef INET_WITH_IPv4
856 initAckChunk->setIpv4Supported(
true);
858 initAckChunk->setIpv4Supported(
false);
860 #ifdef INET_WITH_IPv6
861 initAckChunk->setIpv6Supported(
true);
863 initAckChunk->setIpv6Supported(
false);
865 if (initAckChunk->getIpv4Supported() || initAckChunk->getIpv6Supported()) {
868 uint32_t addrNum = 0;
869 bool friendly =
false;
870 if (
sctpMain->hasPar(
"natFriendly")) {
871 friendly =
sctpMain->par(
"natFriendly");
875 initAckChunk->setAddressesArraySize(addrNum + 1);
876 initAckChunk->setAddresses(addrNum++, (elem));
887 initAckChunk->setSepChunksArraySize(++
count);
888 initAckChunk->setSepChunks(
count - 1,
AUTH);
889 for (int32_t
k = 0;
k < 32;
k++) {
890 initAckChunk->setRandomArraySize(
k + 1);
891 initAckChunk->setRandom(
k, (uint8_t)(
RNGCONTEXT intrand(256)));
893 initAckChunk->setSctpChunkTypesArraySize(
state->
chunkList.size());
896 initAckChunk->setSctpChunkTypes(
k, (elem));
899 initAckChunk->setHmacTypesArraySize(1);
900 initAckChunk->setHmacTypes(0, 1);
901 length +=
ADD_PADDING(initAckChunk->getSctpChunkTypesArraySize() + 48);
903 uint32_t unknownLen = initChunk->getUnrecognizedParametersArraySize();
904 if (unknownLen > 0) {
905 EV_INFO <<
"Found unrecognized Parameters in INIT chunk with a length of " << unknownLen <<
" bytes.\n";
906 initAckChunk->setUnrecognizedParametersArraySize(unknownLen);
907 for (uint32_t i = 0; i < unknownLen; i++)
908 initAckChunk->setUnrecognizedParameters(i, initChunk->getUnrecognizedParameters(i));
909 length += unknownLen;
912 initAckChunk->setUnrecognizedParametersArraySize(0);
915 initAckChunk->setSepChunksArraySize(++
count);
920 initAckChunk->setSepChunksArraySize(++
count);
923 if (
sctpMain->par(
"addIP").boolValue()) {
924 initAckChunk->setSepChunksArraySize(++
count);
926 initAckChunk->setSepChunksArraySize(++
count);
933 initAckChunk->setForwardTsn(
true);
936 initAckChunk->setByteLength(length + initAckChunk->getCookieArraySize() + cookie->getLength());
937 inboundStreams = ((initChunk->getNoOutStreams() < initAckChunk->getNoInStreams()) ? initChunk->getNoOutStreams() : initAckChunk->getNoInStreams());
938 outboundStreams = ((initChunk->getNoInStreams() < initAckChunk->getNoOutStreams()) ? initChunk->getNoInStreams() : initAckChunk->getNoOutStreams());
940 sctpinitack->appendSctpChunks(initAckChunk);
941 Packet *fp =
new Packet(
"INIT-ACK");
Referenced by processInitArrived().
◆ sendInvalidStreamError()
| void inet::sctp::SctpAssociation::sendInvalidStreamError |
( |
uint16_t |
sid | ) |
|
|
protected |
1871 const auto& sctpmsg = makeShared<SctpHeader>();
1873 SctpErrorChunk *errorChunk =
new SctpErrorChunk();
1874 errorChunk->setSctpChunkType(
ERRORTYPE);
1875 SctpSimpleErrorCauseParameter *cause =
new SctpSimpleErrorCauseParameter();
1877 cause->setByteLength(8);
1878 cause->setValue(sid);
1879 errorChunk->setByteLength(4);
1880 errorChunk->addParameters(cause);
1881 sctpmsg->appendSctpChunks(errorChunk);
1889 sctpmsg->appendSctpChunks(authChunk);
1891 it->second.numAuthChunksSent++;
1893 sctpmsg->appendSctpChunks(sackChunk);
Referenced by processDataArrived().
◆ sendOnAllPaths()
◆ sendOnPath()
| void inet::sctp::SctpAssociation::sendOnPath |
( |
SctpPathVariables * |
pathId, |
|
|
const bool |
firstPass = true |
|
) |
| |
Utility: Send data from sendQueue.
663 Ptr<SctpHeader> sctpMsg;
664 SctpSackChunk *sackChunk =
nullptr;
665 SctpDataChunk *dataChunkPtr =
nullptr;
666 SctpForwardTsnChunk *forwardChunk =
nullptr;
668 uint16_t chunksAdded = 0;
669 uint16_t dataChunksAdded = 0;
670 uint32_t totalChunksSent = 0;
671 uint32_t totalPacketsSent = 0;
672 uint32_t outstandingBytes = 0;
677 int32_t bytesToSend = 0;
679 bool headerCreated =
false;
680 bool sendOneMorePacket =
false;
681 bool sendingAllowed =
true;
682 bool authAdded =
false;
683 bool sackAdded =
false;
684 bool forwardPresent =
false;
694 EV_INFO << endl <<
"##### sendAll(";
696 EV_INFO << pathId->remoteAddress;
698 EV_INFO <<
") at t=" << simTime() <<
" #####" << endl;
700 unsigned int safetyCounter = 0;
702 if (safetyCounter++ >= 1000) {
703 throw cRuntimeError(
"Endless loop in SctpAssociation::sendOnPath()?! This should not happen ...");
706 headerCreated =
false;
710 assert(path !=
nullptr);
713 if (pathId ==
nullptr) {
726 if (path->lastTransmission < simTime()) {
728 path->packetsInBurst = 0;
746 outstandingBytes = path->outstandingBytes;
747 assert((int32_t)outstandingBytes >= 0);
752 EV_INFO <<
"\nsendAll: on " << path->remoteAddress <<
":"
753 <<
" tcount=" << tcount
754 <<
" Tcount=" << Tcount
755 <<
" scount=" << scount
761 if ((tcount == 0 && scount == 0) || (!
state->
allowCMT && tcount == 0 && Tcount > 0)) {
763 EV_DETAIL <<
"No DATA chunk available!" << endl;
765 EV_DETAIL <<
"No SACK to send either" << endl;
786 EV_DETAIL <<
"packet was stored -> load packet" << endl;
787 loadPacket(path, &sctpMsg, &chunksAdded, &dataChunksAdded, &authAdded);
788 headerCreated =
true;
790 else if (bytesToSend > 0 ||
bytes.
chunk ||
bytes.
packet || sackWithData || sackOnly || forwardPresent) {
791 sctpMsg = makeShared<SctpHeader>();
793 headerCreated =
true;
797 if (!sackAdded && (sackWithData || sackOnly)) {
799 assert(headerCreated ==
true);
803 EV <<
"Adding dacPacketsRcvd=" << (
unsigned int)
dacPacketsRcvd <<
" to SACK" << endl;
814 sctpMsg->appendSctpChunks(sackChunk);
816 EV_DETAIL <<
assocId <<
": SACK added, chunksAdded now " << chunksAdded <<
" sackOnly=" << sackOnly <<
" sackWithData=" << sackWithData <<
"\n";
819 path->lastTransmission = simTime();
820 path->packetsInBurst++;
840 if (!headerCreated) {
841 sctpMsg = makeShared<SctpHeader>();
843 headerCreated =
true;
848 sctpMsg->appendSctpChunks(forwardChunk);
849 forwardPresent =
true;
850 if (!path->T3_RtxTimer->isScheduled()) {
854 if (bytesToSend == 0) {
855 Packet *pkt =
new Packet(
"DATA");
856 sendToIP(pkt, sctpMsg, path->remoteAddress);
858 forwardPresent =
false;
859 headerCreated =
false;
869 bool packetFull =
false;
871 while (!packetFull && headerCreated) {
872 assert(headerCreated ==
true);
873 EV_DETAIL <<
assocId <<
": bytesToSend=" << bytesToSend
878 int32_t allowance = path->pmtu;
896 else if ((path->outstandingBytes == 0) && (firstPass)) {
900 if ((int32_t)path->cwnd - (int32_t)path->outstandingBytes >= (int32_t)path->pmtu) {
915 int32_t totalOutstanding = 0;
916 int32_t totalCwnd = 0;
917 for (SctpPathMap::const_iterator pathMapIterator =
sctpPathMap.begin();
918 pathMapIterator !=
sctpPathMap.end(); pathMapIterator++)
921 totalOutstanding += myPath->outstandingBytes;
922 totalCwnd += myPath->cwnd;
924 if ((int32_t)(totalCwnd - totalOutstanding) < (int32_t)(path->pmtu)) {
948 bool firstTime =
false;
949 SctpDataVariables *datVar =
nullptr;
956 path->pmtu -
B(sctpMsg->getChunkLength()).get() - 20,
958 if (datVar ==
nullptr) {
959 if (chunksAdded == 1 && sackAdded) {
961 path->pmtu -
B(sctpMsg->getChunkLength()).get() + sackChunk->getByteLength() - 20,
964 auto x = sctpMsg->removeFirstChunk();
965 ASSERT(x == sackChunk);
966 EV_DETAIL <<
"RTX: Remove SACK chunk\n";
972 path->lastTransmission = simTime();
973 path->packetsInBurst++;
976 if (dataChunksAdded > 0) {
984 EV_DETAIL <<
"RTX: send only SACK\n";
989 sctpMsg = makeShared<SctpHeader>();
992 headerCreated =
true;
1008 sctpMsg->appendSctpChunks(forwardChunk);
1009 forwardPresent =
true;
1010 if (!path->T3_RtxTimer->isScheduled()) {
1012 startTimer(path->T3_RtxTimer, path->pathRto);
1017 if (datVar !=
nullptr) {
1018 assert(datVar->getNextDestinationPath() == path);
1019 datVar->numberOfRetransmissions++;
1021 EV_DETAIL << simTime() <<
": Retransmission #" << datVar->numberOfRetransmissions
1022 <<
" of TSN " << datVar->tsn
1023 <<
" on path " << datVar->getNextDestination()
1024 <<
" (last was " << datVar->getLastDestination() <<
")" << endl;
1028 if (datVar->getLastDestinationPath() != datVar->getNextDestinationPath()) {
1030 oldPath->findPseudoCumAck =
true;
1031 oldPath->findRTXPseudoCumAck =
true;
1033 newPath->findPseudoCumAck =
true;
1034 newPath->findRTXPseudoCumAck =
true;
1036 datVar->wasDropped =
false;
1037 datVar->countsAsOutstanding =
true;
1038 datVar->hasBeenReneged =
false;
1045 ((uint32_t)scount >= path->pmtu - 32 - 20) ||
1046 ((scount > 0) && (
state->
nagleEnabled) && ((outstandingBytes == 0) || (sackOnly && sackAdded))) ||
1049 bool rejected =
false;
1051 path->outstandingBytes : path->queuedBytes;
1059 if (bytesOnPath + path->pmtu > limit) {
1061 EV << simTime() <<
":\tSenderBufferSplitting: Rejecting transmission on "
1062 << path->remoteAddress <<
", since "
1063 << bytesOnPath <<
" + " << path->pmtu <<
" > "
1069 if ((rejected ==
false) &&
1076 if (bytesOnPath + path->pmtu > limit + path->pmtu) {
1078 EV << simTime() <<
":\tReceiverBufferSplitting: Rejecting transmission on "
1079 << path->remoteAddress <<
", since "
1080 << bytesOnPath + path->pmtu <<
" > " << limit << endl;
1091 EV_DETAIL <<
assocId <<
"sendAll: sctpMsg->length=" <<
B(sctpMsg->getChunkLength()).get()
1092 <<
" length datMsg=" << path->pmtu -
B(sctpMsg->getChunkLength()).get() - 20 << endl;
1095 if (datMsg ==
nullptr) {
1096 if (chunksAdded == 1 && sackAdded) {
1097 datMsg =
dequeueOutboundDataMsg(path, path->pmtu -
B(sctpMsg->getChunkLength()).get() + sackChunk->getByteLength() - 20,
1100 sctpMsg->removeFirstChunk();
1101 EV_INFO <<
assocId <<
": delete SACK chunk to make room for datMsg (" << &datMsg <<
"). scount=" << scount <<
"\n";
1107 path->lastTransmission = simTime();
1108 path->packetsInBurst++;
1111 if (dataChunksAdded > 0) {
1119 EV_DETAIL <<
assocId <<
": send SACK and make new header for datMsg (" << &datMsg <<
"). scount=" << scount <<
"\n";
1122 if (datMsg !=
nullptr) {
1123 sctpMsg = makeShared<SctpHeader>();
1126 headerCreated =
true;
1136 if (datMsg->getFragment()) {
1137 if (datMsg->getBBit() && !datMsg->getEBit()) {
1141 if (datMsg->getEBit()) {
1159 EV_DETAIL <<
assocId <<
":: sendAll: chunk " << datVar <<
" dequeued from StreamQ "
1160 << datVar->sid <<
": tsn=" << datVar->tsn
1165 EV_DETAIL <<
assocId <<
": No data message has been dequeued" << endl;
1167 if (chunksAdded == 0) {
1177 if (
state->
nagleEnabled && ((outstandingBytes > 0) && !(sackOnly && sackAdded)) &&
1179 (
B(sctpMsg->getChunkLength()).get() < path->pmtu - 32 - 20) && (tcount == 0))
1181 EV_DETAIL <<
"Nagle: Packet has to be stored\n";
1182 storePacket(path, sctpMsg, chunksAdded, dataChunksAdded, authAdded);
1187 EV_DETAIL <<
"sendAll: packetFull: msg length = " <<
B(sctpMsg->getChunkLength()).get() + 20 <<
"\n";
1191 else if (chunksAdded == 1 && sackAdded && !sackOnly) {
1192 sctpMsg->removeFirstChunk();
1193 EV_DETAIL <<
"Nagle or no data: Remove SACK chunk, delete sctpmsg" << endl;
1199 else if ((chunksAdded == 1 && sackAdded && sackOnly) || headerCreated) {
1209 else if (chunksAdded == 1 && sackAdded && !sackOnly) {
1210 sctpMsg->removeFirstChunk();
1211 EV_DETAIL <<
"Nagle or no data: Remove SACK chunk, delete sctpmsg\n";
1217 else if (chunksAdded == 1 && sackAdded && sackOnly) {
1220 else if (datVar ==
nullptr || chunksAdded == 0) {
1221 EV_DETAIL <<
"HeaderCreated=" << headerCreated <<
", chunksAdded=" << chunksAdded <<
" datVar=" << datVar <<
"\n";
1222 if (headerCreated) {
1228 if (datVar !=
nullptr && !packetFull) {
1231 assert(datVar->tsn == 0);
1233 EV_DETAIL <<
"sendAll: set TSN=" << datVar->tsn
1234 <<
" sid=" << datVar->sid <<
", ssn=" << datVar->ssn <<
"\n";
1236 path->vectorPathSentTsn->record(datVar->tsn);
1239 if (datVar->hasBeenFastRetransmitted) {
1240 path->vectorPathTsnFastRTX->record(datVar->tsn);
1243 path->vectorPathTsnTimerBased->record(datVar->tsn);
1248 iterator->second.transmittedBytes += datVar->len / 8;
1250 datVar->setLastDestination(path);
1251 datVar->countsAsOutstanding =
true;
1252 datVar->hasBeenReneged =
false;
1253 datVar->sendTime = simTime();
1254 if (datVar->firstSendTime == 0) {
1255 datVar->firstSendTime = simTime();
1259 if (datVar->numberOfTransmissions == 0) {
1260 EV_DETAIL <<
"sendAll: " << simTime() <<
" firstTime, TSN "
1261 << datVar->tsn <<
": lastDestination set to "
1262 << datVar->getLastDestination() << endl;
1267 EV_DETAIL <<
"sendAll: insert in retransmissionQ tsn=" << datVar->tsn <<
"\n";
1269 throw cRuntimeError(
"Cannot add datVar to retransmissionQ!");
1276 datVar->queuedOnPath = path;
1277 datVar->queuedOnPath->queuedBytes += datVar->booksize;
1278 datVar->queuedOnPath->statisticsPathQueuedSentBytes->record(path->queuedBytes);
1286 datVar->numberOfTransmissions++;
1287 datVar->gapReports = 0;
1288 datVar->hasBeenFastRetransmitted =
false;
1289 EV_DETAIL <<
"sendAll(): adding new outbound data datVar to packet (tsn=" << datVar->tsn <<
")...!!!\n";
1296 sctpMsg->appendSctpChunks(dataChunkPtr);
1298 EV_DETAIL <<
assocId <<
": DataChunk added - TSN:" << dataChunkPtr->getTsn() <<
" - length:" << dataChunkPtr->getByteLength() <<
" - ssn:" << dataChunkPtr->getSsn() <<
"\n";
1300 if (datVar->numberOfTransmissions > 1) {
1302 if (tq->second > 0) {
1321 bytesToSend -= datVar->booksize;
1330 if (bytesToSend <= 0) {
1332 sendOneMorePacket =
true;
1334 EV_DETAIL <<
assocId <<
": sendAll: one more packet allowed\n";
1339 (
B(sctpMsg->getChunkLength()).get() < path->pmtu - 32 - 20) && (tcount == 0))
1341 storePacket(path, sctpMsg, chunksAdded, dataChunksAdded, authAdded);
1354 EV_DETAIL <<
"sendAll: no data in send and transQ: packet full\n";
1356 EV_DETAIL <<
"sendAll: bytesToSend after reduction: " << bytesToSend <<
"\n";
1360 if (chunksAdded == 0) {
1365 EV_DETAIL <<
assocId <<
": sendAll: packetFull: msg length = " <<
B(sctpMsg->getChunkLength()).get() + 20 <<
"\n";
1373 if (chunksAdded == 0) {
1375 sendingAllowed =
false;
1378 EV_DETAIL <<
assocId <<
":: sendAll: " << simTime() <<
" packet full:"
1379 <<
" totalLength=" <<
B(sctpMsg->getChunkLength()).get() + 20
1380 <<
", path=" << path->remoteAddress
1381 <<
" " << dataChunksAdded <<
" chunks added, outstandingBytes now "
1382 << path->outstandingBytes <<
"\n";
1386 if (dataChunksAdded > 0) {
1387 if (!path->T3_RtxTimer->isScheduled()) {
1389 startTimer(path->T3_RtxTimer, path->pathRto);
1392 EV_DETAIL <<
"sendAll: RTX Timer already scheduled -> no need to schedule it\n";
1399 if (sendOneMorePacket) {
1400 sendOneMorePacket =
false;
1403 size_t len = sctpMsg->getSctpChunksArraySize() - 1;
1404 SctpChunk *chunk = (SctpChunk *)sctpMsg->getSctpChunks(len);
1405 SctpDataChunk *pkt = check_and_cast<SctpDataChunk *>(chunk);
1408 sctpMsg->setSctpChunks(sctpMsg->getSctpChunksArraySize() - 1, pkt);
1412 const int32_t a = (int32_t)path->cwnd - (int32_t)path->outstandingBytes;
1414 SctpDataChunk *pkt = check_and_cast<SctpDataChunk *>(sctpMsg->peekLastChunk());
1418 if (dataChunksAdded > 0) {
1421 EV_DETAIL <<
assocId <<
":sendToIP: packet size=" <<
B(sctpMsg->getChunkLength()).get() <<
" numChunks=" << sctpMsg->getSctpChunksArraySize() <<
"\n";
1422 Packet *pkt =
new Packet(
"DATA");
1423 sendToIP(pkt, sctpMsg, path->remoteAddress);
1427 path->lastTransmission = simTime();
1428 path->packetsInBurst++;
1434 headerCreated =
false;
1436 dataChunksAdded = 0;
1439 EV_INFO <<
"sendAll: sending Packet to path " << path->remoteAddress
1440 <<
" scount=" << scount
1441 <<
" tcount=" << tcount
1442 <<
" bytesToSend=" << bytesToSend << endl;
1445 EV_INFO <<
"sendAll: still " << bytesToSend
1446 <<
" bytes to send, headerCreated=" << headerCreated << endl;
1449 Packet *pkt =
new Packet(
"DATA");
1450 sendToIP(pkt, sctpMsg, path->remoteAddress);
1459 EV_INFO <<
"packetFull=" << packetFull << endl;
1462 EV_INFO <<
"bytesToSend=" << bytesToSend
1466 sendingAllowed =
false;
1473 EV_INFO <<
"sendAll: nothing more to send... BYE!\n";
Referenced by sendBundledOutgoingResetAndResponse(), inet::sctp::SctpAlg::sendCommandInvoked(), sendDoubleStreamResetResponse(), sendOnAllPaths(), sendOutgoingResetRequest(), sendStreamResetRequest(), and sendStreamResetResponse().
◆ sendOutgoingRequestAndResponse() [1/2]
456 EV_INFO <<
"sendOutgoingRequestAndResponse to " <<
remoteAddr <<
"\n";
457 const auto& msg = makeShared<SctpHeader>();
461 SctpStreamResetChunk *resChunk =
new SctpStreamResetChunk();
465 SctpResetTimer *
rt =
new SctpResetTimer();
466 SctpOutgoingSsnResetRequestParameter *outResetParam;
467 outResetParam =
new SctpOutgoingSsnResetRequestParameter();
469 outResetParam->setSrReqSn(srsn);
470 outResetParam->setSrResSn(inRequestParam->getSrReqSn());
472 if (inRequestParam->getStreamNumbersArraySize() > 0) {
473 outResetParam->setStreamNumbersArraySize(inRequestParam->getStreamNumbersArraySize());
474 for (
uint i = 0; i < inRequestParam->getStreamNumbersArraySize(); i++) {
475 outResetParam->setStreamNumbers(i, (uint16_t)inRequestParam->getStreamNumbers(i));
477 state->
requests[srsn].streams.push_back(outResetParam->getStreamNumbers(i));
482 resChunk->addParameter(outResetParam);
484 SctpStreamResetResponseParameter *responseParam =
new SctpStreamResetResponseParameter();
486 responseParam->setSrResSn(outRequestParam->getSrReqSn());
487 responseParam->setResult(1);
489 resChunk->addParameter(responseParam);
490 rt->setInSN(srsn - 1);
491 rt->setInAcked(
false);
492 rt->setOutSN(outRequestParam->getSrReqSn());
493 rt->setOutAcked(
false);
499 it->second.numResetRequestsSent++;
500 state->
resetChunk = check_and_cast<SctpStreamResetChunk *>(resChunk->dup());
502 msg->appendSctpChunks(resChunk);
503 Packet *pkt =
new Packet(
"RE_CONFIG");
◆ sendOutgoingRequestAndResponse() [2/2]
| void inet::sctp::SctpAssociation::sendOutgoingRequestAndResponse |
( |
uint32_t |
inRequestSn, |
|
|
uint32_t |
outRequestSn |
|
) |
| |
|
protected |
411 EV_INFO <<
"sendOutgoingResetRequest to " <<
remoteAddr <<
"\n";
412 const auto& msg = makeShared<SctpHeader>();
416 SctpStreamResetChunk *resChunk =
new SctpStreamResetChunk();
420 SctpResetTimer *
rt =
new SctpResetTimer();
421 SctpOutgoingSsnResetRequestParameter *outResetParam;
422 outResetParam =
new SctpOutgoingSsnResetRequestParameter();
424 outResetParam->setSrReqSn(srsn++);
425 outResetParam->setSrResSn(inRequestSn);
428 resChunk->addParameter(outResetParam);
430 SctpStreamResetResponseParameter *responseParam =
new SctpStreamResetResponseParameter();
432 responseParam->setSrResSn(outRequestSn);
433 responseParam->setResult(1);
435 resChunk->addParameter(responseParam);
436 rt->setInSN(srsn - 1);
437 rt->setInAcked(
false);
438 rt->setOutSN(outRequestSn);
439 rt->setOutAcked(
false);
445 msg->appendSctpChunks(resChunk);
446 Packet *pkt =
new Packet(
"RE_CONFIG");
Referenced by process_RCV_Message(), and processInAndOutResetRequestArrived().
◆ sendOutgoingResetRequest()
118 EV_INFO <<
"sendOutgoingResetRequest to " <<
remoteAddr <<
"\n";
123 SctpStreamResetChunk *resetChunk =
new SctpStreamResetChunk();
126 SctpOutgoingSsnResetRequestParameter *outResetParam;
127 outResetParam =
new SctpOutgoingSsnResetRequestParameter();
140 outResetParam->setSrReqSn(srsn++);
141 outResetParam->setSrResSn(requestParam->getSrReqSn());
156 outResetParam->setStreamNumbers(i, *it);
158 state->
requests[srsn - 1].streams.push_back(outResetParam->getStreamNumbers(i));
168 outResetParam->setStreamNumbers(i, *it);
170 state->
requests[srsn - 1].streams.push_back(outResetParam->getStreamNumbers(i));
171 resetSsn(outResetParam->getStreamNumbers(i));
177 else if (requestParam->getStreamNumbersArraySize() > 0) {
178 outResetParam->setStreamNumbersArraySize(requestParam->getStreamNumbersArraySize());
179 for (uint16_t i = 0; i < requestParam->getStreamNumbersArraySize(); i++) {
180 outResetParam->setStreamNumbers(i, requestParam->getStreamNumbers(i));
181 state->
requests[srsn - 1].streams.push_back(requestParam->getStreamNumbers(i));
183 len = requestParam->getStreamNumbersArraySize() * 2;
186 resetChunk->addParameter(outResetParam);
190 SctpResetTimer *
rt =
new SctpResetTimer();
192 rt->setInAcked(
true);
193 rt->setOutSN(srsn - 1);
194 rt->setOutAcked(
false);
196 const auto& msg = makeShared<SctpHeader>();
200 msg->appendSctpChunks(resetChunk);
206 state->
resetChunk = check_and_cast<SctpStreamResetChunk *>(resetChunk->dup());
214 Packet *pkt =
new Packet(
"RE_CONFIG");
Referenced by processIncomingResetRequestArrived().
◆ sendPacketDrop()
| void inet::sctp::SctpAssociation::sendPacketDrop |
( |
const bool |
flag | ) |
|
|
protected |
1246 EV_INFO <<
"sendPacketDrop:\t";
1247 SctpHeader *drop = (SctpHeader *)
state->sctpmsg->dup();
1248 if (drop->getSctpChunksArraySize() == 1) {
1249 SctpChunk *header = (SctpChunk *)(drop->getSctpChunks(0));
1250 if (header->getSctpChunkType() ==
PKTDROP) {
1256 const auto& sctpmsg = makeShared<SctpHeader>();
1258 SctpPacketDropChunk *pktdrop =
new SctpPacketDropChunk();
1259 pktdrop->setSctpChunkType(
PKTDROP);
1260 pktdrop->setCFlag(
false);
1261 pktdrop->setTFlag(
false);
1262 pktdrop->setBFlag(flag);
1263 pktdrop->setMFlag(
false);
1264 pktdrop->setMaxRwnd(
sctpMain->par(
"arwnd"));
1266 pktdrop->setTruncLength(0);
1269 if (
B(drop->getChunkLength()).get() > mss) {
1270 uint16_t diff =
B(drop->getChunkLength()).get() - mss;
1271 pktdrop->setTruncLength(
B(drop->getChunkLength()).get());
1272 SctpChunk *sctpchunk = (SctpChunk *)(drop->removeLastChunk());
1273 if (sctpchunk->getSctpChunkType() ==
DATA) {
1274 SctpDataChunk *dataChunk = check_and_cast<SctpDataChunk *>(sctpchunk);
1277 SctpSimpleMessage *smsg = check_and_cast<SctpSimpleMessage *>(dataChunk->decapsulate());
1279 if (smsg->getDataLen() > diff) {
1280 uint16_t newLength = smsg->getDataLen() - diff;
1281 smsg->setDataArraySize(newLength);
1282 for (uint16_t i = 0; i < newLength; i++)
1283 smsg->setData(i,
'a');
1284 smsg->setDataLen(newLength);
1285 smsg->setEncaps(
false);
1286 smsg->setByteLength(newLength);
1287 dataChunk->encapsulate((cPacket *)smsg);
1289 drop->appendSctpChunks(dataChunk);
1291 else if (drop->getSctpChunksArraySize() == 1) {
1295 EV_DETAIL <<
"laenge=" <<
B(drop->getChunkLength()).get() <<
" numberOfChunks=1\n";
1303 EV_DETAIL <<
"laenge=" <<
B(drop->getChunkLength()).get() <<
" numberOfChunks=1\n";
1307 pktdrop->setTFlag(
true);
1313 EV_DETAIL <<
"length of PKTDROP chunk=" << pktdrop->getByteLength() <<
"\n";
1314 sctpmsg->appendSctpChunks(pktdrop);
1315 EV_DETAIL <<
"total length now " <<
B(sctpmsg->getChunkLength()).get() <<
"\n";
1319 Packet *fp =
new Packet(
"PKTDROP");
Referenced by processDataArrived().
◆ sendSack()
| void inet::sctp::SctpAssociation::sendSack |
( |
| ) |
|
|
protected |
◆ sendSACKviaSelectedPath()
| void inet::sctp::SctpAssociation::sendSACKviaSelectedPath |
( |
const Ptr< SctpHeader > & |
sctpMsg | ) |
|
|
private |
504 assert(sackPath !=
nullptr);
522 if (path->lastSACKSent < sackPath->lastSACKSent) {
531 if (path->srtt < sackPath->srtt) {
540 EV_INFO <<
assocId <<
": sending SACK to " << sackPath->remoteAddress << endl;
541 Packet *pkt =
new Packet(
"SACK");
542 sendToIP(pkt, sctpMsg, sackPath->remoteAddress);
543 sackPath->lastSACKSent = simTime();
Referenced by sendInvalidStreamError(), sendOnPath(), and sendSack().
◆ sendShutdown()
| void inet::sctp::SctpAssociation::sendShutdown |
( |
| ) |
|
|
protected |
1183 SctpAuthenticationChunk *authChunk;
1184 const auto& msg = makeShared<SctpHeader>();
1187 EV_INFO <<
"SctpAssociationUtil:sendShutdown localPort=" <<
localPort <<
" remotePort=" <<
remotePort <<
"\n";
1191 SctpShutdownChunk *shutdownChunk =
new SctpShutdownChunk();
1192 shutdownChunk->setSctpChunkType(
SHUTDOWN);
1198 msg->appendSctpChunks(authChunk);
1200 it->second.numAuthChunksSent++;
1209 msg->appendSctpChunks(shutdownChunk);
1210 Packet *fp =
new Packet(
"SHUTDOWN");
Referenced by process_CLOSE(), process_RCV_Message(), and stateEntered().
◆ sendShutdownAck()
| void inet::sctp::SctpAssociation::sendShutdownAck |
( |
const L3Address & |
dest | ) |
|
|
protected |
◆ sendShutdownComplete()
| void inet::sctp::SctpAssociation::sendShutdownComplete |
( |
| ) |
|
|
protected |
1137 const auto& sctpshutdowncomplete = makeShared<SctpHeader>();
1140 EV_INFO <<
"SctpAssociationUtil:sendShutdownComplete\n";
1142 sctpshutdowncomplete->setSrcPort(
localPort);
1143 sctpshutdowncomplete->setDestPort(
remotePort);
1144 SctpShutdownCompleteChunk *shutdownCompleteChunk =
new SctpShutdownCompleteChunk();
1146 shutdownCompleteChunk->setTBit(0);
1148 sctpshutdowncomplete->appendSctpChunks(shutdownCompleteChunk);
1149 Packet *fp =
new Packet(
"SHUTDOWN-COMPLETE");
1150 sendToIP(fp, sctpshutdowncomplete);
Referenced by process_RCV_Message().
◆ sendStreamPresent()
| bool inet::sctp::SctpAssociation::sendStreamPresent |
( |
uint32_t |
sid | ) |
|
|
protected |
◆ sendStreamResetRequest()
| void inet::sctp::SctpAssociation::sendStreamResetRequest |
( |
SctpResetReq * |
info | ) |
|
|
protected |
514 EV_INFO <<
"StreamReset:sendStreamResetRequest\n";
515 SctpParameter *param;
517 const auto& msg = makeShared<SctpHeader>();
521 SctpStreamResetChunk *resetChunk =
new SctpStreamResetChunk();
525 SctpResetTimer *
rt =
new SctpResetTimer();
528 type = rinfo->getRequestType();
533 EV_INFO <<
"RESET_OUTGOING\n";
538 resetChunk->addParameter(param);
540 rt->setInAcked(
true);
542 rt->setOutAcked(
false);
543 it->second.numResetRequestsSent++;
551 EV_INFO <<
"RESET_INCOMING\n";
556 resetChunk->addParameter(param);
558 rt->setInAcked(
false);
560 rt->setOutAcked(
true);
561 it->second.numResetRequestsSent++;
567 EV_INFO <<
"RESET_BOTH\n";
568 SctpParameter *outParam;
573 rt->setOutSN(srsn++);
574 rt->setOutAcked(
false);
575 resetChunk->addParameter(outParam);
579 SctpParameter *inParam;
581 resetChunk->addParameter(inParam);
583 rt->setInAcked(
false);
584 it->second.numResetRequestsSent += 2;
591 resetChunk->addParameter(param);
593 rt->setInAcked(
false);
595 rt->setOutAcked(
false);
598 it->second.numResetRequestsSent++;
604 EV_INFO <<
"ADD_INCOMING or ADD_OUTGOING\n";
607 resetChunk->addParameter(param);
609 rt->setInAcked(
false);
611 rt->setOutAcked(
true);
612 it->second.numResetRequestsSent++;
615 default: EV_INFO <<
"Request type %d not known\n";
623 state->
resetChunk = check_and_cast<SctpStreamResetChunk *>(resetChunk->dup());
624 msg->appendSctpChunks(resetChunk);
632 Packet *pkt =
new Packet(
"RE_CONFIG");
Referenced by checkStreamsToReset(), process_STREAM_RESET(), and sendOnAllPaths().
◆ sendStreamResetResponse() [1/2]
757 EV_INFO <<
"sendStreamResetResponse to " <<
remoteAddr <<
" with options\n";
758 const auto& msg = makeShared<SctpHeader>();
762 SctpStreamResetChunk *resetChunk =
new SctpStreamResetChunk();
765 SctpStreamResetResponseParameter *responseParam =
new SctpStreamResetResponseParameter();
767 responseParam->setSrResSn(requestParam->getSrReqSn());
768 responseParam->setResult(result);
787 responseParam->setByteLength(len);
788 resetChunk->addParameter(responseParam);
789 msg->appendSctpChunks(resetChunk);
794 Packet *pkt =
new Packet(
"RE_CONFIG");
◆ sendStreamResetResponse() [2/2]
| void inet::sctp::SctpAssociation::sendStreamResetResponse |
( |
uint32_t |
srrsn, |
|
|
int |
result |
|
) |
| |
|
protected |
◆ sendToApp()
| void inet::sctp::SctpAssociation::sendToApp |
( |
cMessage * |
msg | ) |
|
|
protected |
◆ sendToIP() [1/2]
| void inet::sctp::SctpAssociation::sendToIP |
( |
Packet * |
pkt, |
|
|
const Ptr< SctpHeader > & |
sctpmsg |
|
) |
| |
|
inlineprotected |
◆ sendToIP() [2/2]
Utility: adds control info to message and sends it to IP.
368 sctpmsg->setChecksumOk(
true);
369 EV_INFO <<
"SendToIP: localPort=" <<
localPort <<
" remotePort=" <<
remotePort <<
" dest=" << dest <<
"\n";
370 const SctpChunk *chunk = sctpmsg->peekFirstChunk();
371 uint8_t chunkType = chunk->getSctpChunkType();
372 if (chunkType ==
ABORT) {
373 const SctpAbortChunk *abortChunk = check_and_cast<const SctpAbortChunk *>(chunk);
374 if (abortChunk->getT_Bit() == 1) {
381 else if (sctpmsg->getVTag() == 0) {
385 EV_INFO <<
"insertTransportProtocolHeader sctpmsg\n";
388 if (
sctpMain->par(
"udpEncapsEnabled").boolValue()) {
389 auto udpHeader = makeShared<UdpHeader>();
392 udpHeader->setTotalLengthField(udpHeader->getChunkLength() + pkt->getTotalLength());
393 EV_INFO <<
"Packet: " << pkt << endl;
396 EV_INFO <<
"After udp header added " << pkt << endl;
403 IL3AddressType *addressType = dest.getAddressType();
404 pkt->addTagIfAbsent<
DispatchProtocolReq>()->setProtocol(addressType->getNetworkProtocol());
409 auto addresses = pkt->addTagIfAbsent<L3AddressReq>();
411 addresses->setDestAddress(dest);
412 pkt->addTagIfAbsent<SocketReq>()->setSocketId(
assocId);
413 EV_INFO <<
"send packet " << pkt <<
" to ipOut\n";
414 check_and_cast<Sctp *>(getSimulation()->getContextModule())->send(pkt,
"ipOut");
418 path->numberOfHeartbeatsSent++;
419 path->vectorPathHb->record(path->numberOfHeartbeatsSent);
423 path->numberOfHeartbeatAcksSent++;
424 path->vectorPathHbAck->record(path->numberOfHeartbeatAcksSent);
427 EV_INFO <<
"Sent to " << dest << endl;
Referenced by processAddInAndOutResetRequestArrived(), processAsconfArrived(), retransmitAsconf(), retransmitCookieEcho(), retransmitInit(), retransmitReset(), retransmitShutdown(), retransmitShutdownAck(), sendAbort(), sendAddInAndOutStreamsRequest(), sendAddOutgoingStreamsRequest(), sendAsconf(), sendAsconfAck(), sendBundledOutgoingResetAndResponse(), sendCookieAck(), sendCookieEcho(), sendDoubleStreamResetResponse(), sendHeartbeat(), sendHeartbeatAck(), sendInit(), sendInitAck(), sendOnPath(), sendOutgoingRequestAndResponse(), sendOutgoingResetRequest(), sendPacketDrop(), sendSACKviaSelectedPath(), sendShutdown(), sendShutdownAck(), sendShutdownComplete(), sendStreamResetRequest(), and sendStreamResetResponse().
◆ setFragInProgressOfStream()
| void inet::sctp::SctpAssociation::setFragInProgressOfStream |
( |
uint16_t |
sid, |
|
|
bool |
frag |
|
) |
| |
|
protected |
108 return streamIterator->second->setFragInProgress(frag);
Referenced by sendOnPath().
◆ signalConnectionTimeout()
| void inet::sctp::SctpAssociation::signalConnectionTimeout |
( |
| ) |
|
|
protected |
Utility: signal to user that connection timed out.
◆ ssnGt()
| static bool inet::sctp::SctpAssociation::ssnGt |
( |
const uint16_t |
ssn1, |
|
|
const uint16_t |
ssn2 |
|
) |
| |
|
inlinestatic |
◆ startTimer()
| void inet::sctp::SctpAssociation::startTimer |
( |
cMessage * |
timer, |
|
|
const simtime_t & |
timeout |
|
) |
| |
|
protected |
3677 EV_DETAIL <<
"startTimer " << timer->getName() <<
" with timeout "
3678 << timeout <<
" to expire at " << simTime() + timeout << endl;
Referenced by chunkReschedulingControl(), pmDataIsSentOn(), pmStartPathManagement(), process_ASSOCIATE(), process_TIMEOUT_ASCONF(), process_TIMEOUT_HEARTBEAT_INTERVAL(), process_TIMEOUT_INIT_REXMIT(), process_TIMEOUT_RESET(), process_TIMEOUT_SHUTDOWN(), processAddInAndOutResetRequestArrived(), processAsconfArrived(), processInitAckArrived(), processPacketDropArrived(), processSackArrived(), rpPathBlockingControl(), scheduleSack(), sendAddInAndOutStreamsRequest(), sendAddOutgoingStreamsRequest(), sendBundledOutgoingResetAndResponse(), sendOnPath(), sendOutgoingRequestAndResponse(), sendOutgoingResetRequest(), sendShutdown(), sendShutdownAck(), sendStreamResetRequest(), and tsnWasReneged().
◆ stateEntered()
| void inet::sctp::SctpAssociation::stateEntered |
( |
int32_t |
state | ) |
|
|
protected |
1425 EV_INFO <<
"State ESTABLISHED entered" << endl;
1447 const char *maxBurstVariantPar =
sctpMain->par(
"maxBurstVariant").stringValue();
1448 if (strcmp(maxBurstVariantPar,
"useItOrLoseIt") == 0) {
1451 else if (strcmp(maxBurstVariantPar,
"congestionWindowLimiting") == 0) {
1454 else if (strcmp(maxBurstVariantPar,
"maxBurst") == 0) {
1457 else if (strcmp(maxBurstVariantPar,
"aggressiveMaxBurst") == 0) {
1460 else if (strcmp(maxBurstVariantPar,
"totalMaxBurst") == 0) {
1463 else if (strcmp(maxBurstVariantPar,
"useItOrLoseItTempCwnd") == 0) {
1466 else if (strcmp(maxBurstVariantPar,
"congestionWindowLimitingTempCwnd") == 0) {
1470 throw cRuntimeError(
"Invalid setting of maxBurstVariant: %s.",
1471 maxBurstVariantPar);
1474 const char *cmtSendAllVariantPar =
sctpMain->par(
"cmtSendAllVariant").stringValue();
1475 if (strcmp(cmtSendAllVariantPar,
"normal") == 0) {
1478 else if (strcmp(cmtSendAllVariantPar,
"smallestLastTransmission") == 0) {
1481 else if (strcmp(cmtSendAllVariantPar,
"randomized") == 0) {
1484 else if (strcmp(cmtSendAllVariantPar,
"largestSSThreshold") == 0) {
1487 else if (strcmp(cmtSendAllVariantPar,
"largestSpace") == 0) {
1490 else if (strcmp(cmtSendAllVariantPar,
"largestSpaceAndSSThreshold") == 0) {
1494 throw cRuntimeError(
"Invalid setting of cmtSendAllVariant: %s.",
1495 cmtSendAllVariantPar);
1499 const char *cmtCUCVariantPar =
sctpMain->par(
"cmtCUCVariant").stringValue();
1500 if (strcmp(cmtCUCVariantPar,
"normal") == 0) {
1503 else if (strcmp(cmtCUCVariantPar,
"pseudoCumAck") == 0) {
1506 else if (strcmp(cmtCUCVariantPar,
"pseudoCumAckV2") == 0) {
1510 throw cRuntimeError(
"Bad setting for cmtCUCVariant: %s\n",
1515 const char *cmtChunkReschedulingVariantPar =
sctpMain->par(
"cmtChunkReschedulingVariant").stringValue();
1516 if (strcmp(cmtChunkReschedulingVariantPar,
"none") == 0) {
1519 else if (strcmp(cmtChunkReschedulingVariantPar,
"senderOnly") == 0) {
1522 else if (strcmp(cmtChunkReschedulingVariantPar,
"receiverOnly") == 0) {
1525 else if (strcmp(cmtChunkReschedulingVariantPar,
"bothSides") == 0) {
1528 else if (strcmp(cmtChunkReschedulingVariantPar,
"test") == 0) {
1532 throw cRuntimeError(
"Bad setting for cmtChunkReschedulingVariant: %s\n",
1533 cmtChunkReschedulingVariantPar);
1536 const char *cmtBufferSplitVariantPar =
sctpMain->par(
"cmtBufferSplitVariant").stringValue();
1537 if (strcmp(cmtBufferSplitVariantPar,
"none") == 0) {
1540 else if (strcmp(cmtBufferSplitVariantPar,
"senderOnly") == 0) {
1543 else if (strcmp(cmtBufferSplitVariantPar,
"receiverOnly") == 0) {
1546 else if (strcmp(cmtBufferSplitVariantPar,
"bothSides") == 0) {
1550 throw cRuntimeError(
"Bad setting for cmtBufferSplitVariant: %s\n",
1551 cmtBufferSplitVariantPar);
1555 const char *gapListOptimizationVariantPar =
sctpMain->par(
"gapListOptimizationVariant").stringValue();
1556 if (strcmp(gapListOptimizationVariantPar,
"none") == 0) {
1559 else if (strcmp(gapListOptimizationVariantPar,
"optimized1") == 0) {
1562 else if (strcmp(gapListOptimizationVariantPar,
"optimized2") == 0) {
1565 else if (strcmp(gapListOptimizationVariantPar,
"shrunken") == 0) {
1569 throw cRuntimeError(
"Bad setting for gapListOptimizationVariant: %s\n",
1570 gapListOptimizationVariantPar);
1586 const char *cmtSackPathPar =
sctpMain->par(
"cmtSackPath").stringValue();
1587 if (strcmp(cmtSackPathPar,
"standard") == 0) {
1590 else if (strcmp(cmtSackPathPar,
"primary") == 0) {
1593 else if (strcmp(cmtSackPathPar,
"roundRobin") == 0) {
1596 else if (strcmp(cmtSackPathPar,
"smallestSRTT") == 0) {
1600 throw cRuntimeError(
"Bad setting for cmtSackPath: %s\n",
1604 const char *cmtCCVariantPar =
sctpMain->par(
"cmtCCVariant").stringValue();
1605 if (strcmp(cmtCCVariantPar,
"off") == 0) {
1609 else if (strcmp(cmtCCVariantPar,
"cmt") == 0) {
1613 else if (strcmp(
sctpMain->par(
"cmtCCVariant").stringValue(),
"lia") == 0) {
1617 else if (strcmp(
sctpMain->par(
"cmtCCVariant").stringValue(),
"olia") == 0) {
1621 else if ((strcmp(cmtCCVariantPar,
"cmtrp") == 0) ||
1622 (strcmp(cmtCCVariantPar,
"cmtrpv1") == 0))
1627 else if (strcmp(cmtCCVariantPar,
"cmtrpv2") == 0) {
1631 else if (strcmp(cmtCCVariantPar,
"cmtrp-t1") == 0) {
1635 else if (strcmp(cmtCCVariantPar,
"cmtrp-t2") == 0) {
1640 throw cRuntimeError(
"Bad setting for cmtCCVariant: %s\n",
1648 cStringTokenizer pathGroupsTokenizer(
sctpMain->par(
"cmtCCPathGroups").stringValue());
1649 if (pathGroupsTokenizer.hasMoreTokens()) {
1652 const char *token = pathGroupsTokenizer.nextToken();
1653 if (token ==
nullptr) {
1654 throw cRuntimeError(
"Too few cmtCCGroup values to cover all paths!");
1657 path->cmtCCGroup = atol(token);
1680 Sctp::AssocStat stat;
1682 stat.start = simTime();
1685 stat.ackedBytes = 0;
1687 stat.transmittedBytes = 0;
1688 stat.numFastRtx = 0;
1691 stat.numPathFailures = 0;
1692 stat.numForwardTsn = 0;
1693 stat.sumRGapRanges = 0;
1694 stat.sumNRGapRanges = 0;
1695 stat.numOverfullSACKs = 0;
1697 stat.throughput = 0;
1698 stat.numDropsBecauseNewTsnGreaterThanHighestTsn = 0;
1699 stat.numDropsBecauseNoRoomInBuffer = 0;
1700 stat.numChunksReneged = 0;
1701 stat.numAuthChunksSent = 0;
1702 stat.numAuthChunksAccepted = 0;
1703 stat.numAuthChunksRejected = 0;
1704 stat.numResetRequestsSent = 0;
1705 stat.numResetRequestsPerformed = 0;
1709 stat.fairLifeTime = 0;
1710 stat.fairThroughput = 0;
1711 stat.fairAckedBytes = 0;
1712 stat.numEndToEndMessages = 0;
1713 stat.cumEndToEndDelay = 0;
1714 stat.startEndToEndDelay =
sctpMain->par(
"startEndToEndDelay");
1715 stat.stopEndToEndDelay =
sctpMain->par(
"stopEndToEndDelay");
1734 EV_INFO <<
"stateEntered: Established socketId= " <<
assocId << endl;
1736 EV_INFO <<
"Listening socket can accept now\n";
1743 const bool addIP =
sctpMain->par(
"addIP");
1744 simtime_t addTime =
sctpMain->par(
"addTime");
1745 EV_DETAIL << getFullPath() <<
": addIP = " << addIP <<
" time = " << addTime <<
"\n";
1746 if (addIP ==
true && addTime > SIMTIME_ZERO) {
1747 EV_DETAIL <<
"startTimer addTime to expire at " << simTime() + addTime <<
"\n";
1752 if ((
double)
sctpMain->par(
"fairStart") > 0) {
1758 snprintf(str,
sizeof(str),
"Cumulated TSN Ack of Association %d",
assocId);
1760 snprintf(str,
sizeof(str),
"Number of Gap Blocks in Last SACK of Association %d",
assocId);
1762 snprintf(str,
sizeof(str),
"SendQueue of Association %d",
assocId);
1765 Sctp::VTagPair vtagPair;
Referenced by performStateTransition().
◆ stateName()
| const char * inet::sctp::SctpAssociation::stateName |
( |
int32_t |
state | ) |
|
|
static |
◆ stopTimer()
| void inet::sctp::SctpAssociation::stopTimer |
( |
cMessage * |
timer | ) |
|
3669 EV_INFO <<
"stopTimer " << timer->getName() << endl;
3670 if (timer->isScheduled()) {
Referenced by chunkReschedulingControl(), pmDataIsSentOn(), pmStartPathManagement(), process_RCV_Message(), process_TIMEOUT_HEARTBEAT_INTERVAL(), process_TIMEOUT_RTX(), processAsconfAckArrived(), processAsconfArrived(), processCookieAckArrived(), processErrorArrived(), processHeartbeatAckArrived(), processInitAckArrived(), processOutAndResponseArrived(), processOutgoingResetRequestArrived(), processPacketDropArrived(), processResetResponseArrived(), processSackArrived(), processTimer(), inet::sctp::Sctp::removeAssociation(), removePath(), sendBundledOutgoingResetAndResponse(), sendInvalidStreamError(), sendOnPath(), sendOutgoingResetRequest(), sendSack(), sendShutdown(), sendShutdownAck(), sendStreamResetRequest(), sendStreamResetResponse(), stateEntered(), and stopTimers().
◆ stopTimers()
| void inet::sctp::SctpAssociation::stopTimers |
( |
| ) |
|
◆ storePacket()
| void inet::sctp::SctpAssociation::storePacket |
( |
SctpPathVariables * |
pathVar, |
|
|
const Ptr< SctpHeader > & |
sctpMsg, |
|
|
uint16_t |
chunksAdded, |
|
|
uint16_t |
dataChunksAdded, |
|
|
bool |
authAdded |
|
) |
| |
|
private |
51 uint32_t packetBytes = 0;
52 for (uint16_t i = 0; i < sctpMsg->getSctpChunksArraySize(); i++) {
53 const SctpChunk *chunkPtr = sctpMsg->getSctpChunks(i);
54 if (chunkPtr->getSctpChunkType() ==
DATA) {
55 const SctpDataChunk *dataChunk = check_and_cast<const SctpDataChunk *>(chunkPtr);
56 if (dataChunk !=
nullptr) {
57 const uint32_t tsn = dataChunk->getTsn();
59 assert(chunk !=
nullptr);
61 chunk->queuedOnPath->queuedBytes -= chunk->booksize;
62 chunk->queuedOnPath =
nullptr;
63 packetBytes += chunk->booksize;
67 state->
sctpMsg = dynamicPtrCast<SctpHeader>(sctpMsg->dupShared());
72 EV_INFO <<
"storePacket: path=" << pathVar->remoteAddress
74 <<
" osb=" << pathVar->outstandingBytes <<
" -> "
Referenced by sendBundledOutgoingResetAndResponse(), sendDoubleStreamResetResponse(), sendOnPath(), sendOutgoingResetRequest(), sendStreamResetRequest(), and sendStreamResetResponse().
◆ streamIsPending()
| bool inet::sctp::SctpAssociation::streamIsPending |
( |
int32_t |
sid | ) |
|
|
protected |
34 std::list<uint16_t>::iterator it;
◆ streamScheduler()
| int32_t inet::sctp::SctpAssociation::streamScheduler |
( |
SctpPathVariables * |
path, |
|
|
bool |
peek |
|
) |
| |
|
protected |
Dealing with streams.
121 EV_DETAIL <<
"Stream Scheduler: chose sid " << sid <<
".\n";
133 if (sid >= 0 && !peek)
144 if (elem.second->getStreamQ()->getLength() > 0 || elem.second->getUnorderedStreamQ()->getLength() > 0) {
154 EV_INFO <<
"Stream Scheduler: RoundRobinPacket (peek: " << peek <<
")" << endl;
Referenced by SctpAssociation().
◆ streamSchedulerFairBandwidth()
| int32_t inet::sctp::SctpAssociation::streamSchedulerFairBandwidth |
( |
SctpPathVariables * |
path, |
|
|
bool |
peek |
|
) |
| |
|
protected |
320 peekMap[elem.first] = elem.second;
322 mapPointer = &peekMap;
Referenced by SctpAssociation().
◆ streamSchedulerFairBandwidthPacket()
| int32_t inet::sctp::SctpAssociation::streamSchedulerFairBandwidthPacket |
( |
SctpPathVariables * |
path, |
|
|
bool |
peek |
|
) |
| |
|
protected |
329 if (elem.second->getUnorderedStreamQ()->getLength() > 0 || elem.second->getStreamQ()->getLength() > 0) {
331 if (elem.second->getUnorderedStreamQ()->getLength() > 0) {
332 packetsize = check_and_cast<SctpSimpleMessage *>(check_and_cast<SctpDataMsg *>(elem.second->getUnorderedStreamQ()->front())->getEncapsulatedPacket())->getByteLength();
334 else if (elem.second->getStreamQ()->getLength() > 0) {
335 packetsize = check_and_cast<SctpSimpleMessage *>(check_and_cast<SctpDataMsg *>(elem.second->getStreamQ()->front())->getEncapsulatedPacket())->getByteLength();
339 if ((*mapPointer)[elem.first] < 0) {
340 if (packetsize > 0) {
341 (*mapPointer)[elem.first] = packetsize;
343 EV_DETAIL <<
"Stream Scheduler: add sid " << elem.first <<
" with size " << packetsize <<
" to fair bandwidth map.\n";
349 (*mapPointer)[elem.first] -= lastDataChunkSize;
350 if ((*mapPointer)[elem.first] < 0)
351 (*mapPointer)[elem.first] = 0;
355 (*mapPointer)[elem.first] += packetsize;
357 EV_DETAIL <<
"Stream Scheduler: updated sid " << elem.first <<
" with new packet of size " << packetsize << endl;
361 EV_DETAIL <<
"Stream Scheduler: updated sid " << elem.first <<
" entry to size " << (*mapPointer)[elem.first] << endl;
366 (*mapPointer)[elem.first] = -1;
368 EV_DETAIL <<
"Stream Scheduler: sid " << elem.first <<
" removed from fb map" << endl;
377 for (
auto& elem : *mapPointer) {
378 if ((sid < 0 || (uint32_t)elem.second < bandwidth) && elem.second >= 0) {
380 bandwidth = elem.second;
382 EV_DETAIL <<
"Stream Scheduler: chose sid " << sid <<
".\n";
392 EV_DETAIL <<
"Stream Scheduler: again sid " << sid <<
".\n";
396 if (sid >= 0 && !peek) {
406 int32_t sid, testsid;
407 simtime_t oldestEnqueuing, testTime;
409 EV_INFO <<
"Stream Scheduler: First-come, first-serve (peek: " << peek <<
")" << endl;
423 if (
sendStreams.find(testsid)->second->getUnorderedStreamQ()->getLength() > 0) {
424 testTime = check_and_cast<SctpDataMsg *>(
sendStreams.find(testsid)->second->getUnorderedStreamQ()->front())->getEnqueuingTime();
425 if (sid < 0 || oldestEnqueuing > testTime) {
426 oldestEnqueuing = testTime;
Referenced by SctpAssociation().
◆ streamSchedulerFCFS()
| int32_t inet::sctp::SctpAssociation::streamSchedulerFCFS |
( |
SctpPathVariables * |
path, |
|
|
bool |
peek |
|
) |
| |
|
protected |
428 : chose sid
" << sid << ".\n
";
432 if (sendStreams.find(testsid)->second->getStreamQ()->getLength() > 0) {
433 testTime = check_and_cast<SctpDataMsg *>(sendStreams.find(testsid)->second->getStreamQ()->front())->getEnqueuingTime();
434 if (sid < 0 || oldestEnqueuing > testTime) {
435 oldestEnqueuing = testTime;
437 EV_DETAIL << "Stream Scheduler: chose sid
" << sid << ".\n
";
440 } while (testsid != (int32_t)state->lastStreamScheduled);
442 if (!peek && sid >= 0)
443 state->lastStreamScheduled = sid;
448 int32_t SctpAssociation::pathStreamSchedulerManual(SctpPathVariables *path, bool peek)
451 int32_t testsid, sid = -1;
452 uint32_t lastsid = state->lastStreamScheduled;
454 EV_INFO << "Stream Scheduler: path-aware Manual (peek:
" << peek << ")
" << endl;
456 if (state->ssStreamToPathMap.empty()) {
457 for (uint16_t str = 0; str < outboundStreams; str++) {
458 state->ssStreamToPathMap[str] = 0;
461 // Fill Stream to Path map
462 uint16_t streamNum = 0;
463 cStringTokenizer prioTokenizer(sctpMain->par("streamsToPaths
"));
464 while (prioTokenizer.hasMoreTokens()) {
465 const char *token = prioTokenizer.nextToken();
466 state->ssStreamToPathMap[streamNum] = (uint32_t)atoi(token);
469 if (state->ssStreamToPathMap.empty())
470 throw cRuntimeError("streamsToPaths not defined
");
Referenced by SctpAssociation().
◆ streamSchedulerPriority()
| int32_t inet::sctp::SctpAssociation::streamSchedulerPriority |
( |
SctpPathVariables * |
path, |
|
|
bool |
peek |
|
) |
| |
|
protected |
276 if (
sendStreams.find(testsid)->second->getUnorderedStreamQ()->getLength() > 0 ||
277 sendStreams.find(testsid)->second->getStreamQ()->getLength() > 0)
281 EV_DETAIL <<
"Stream Scheduler: chose sid " << sid <<
".\n";
286 if (!peek && sid >= 0) {
296 EV_INFO <<
"Stream Scheduler: FairBandwidth (peek: " << peek <<
")" << endl;
303 uint32_t bandwidth = 0, packetsize = 0, lastDataChunkSize;
305 std::map<uint16_t, int32_t> peekMap;
308 EV_INFO <<
"Stream Scheduler: FairBandwidthPacket (peek: " << peek <<
")" << endl;
313 EV_DETAIL <<
"initialize sid " << elem.first <<
" in fb map." << endl;
Referenced by SctpAssociation().
◆ streamSchedulerRandom()
| int32_t inet::sctp::SctpAssociation::streamSchedulerRandom |
( |
SctpPathVariables * |
path, |
|
|
bool |
peek |
|
) |
| |
|
protected |
221 rnd = (int)(ceil(
RNGCONTEXT uniform(1, SctpWaitingSendStreamsList.size()) - 0.5));
222 EV_DETAIL <<
"Stream Scheduler: go to " << rnd <<
". element of waiting stream list.\n";
223 sid = SctpWaitingSendStreamsList[rnd - 1];
Referenced by SctpAssociation().
◆ streamSchedulerRandomPacket()
| int32_t inet::sctp::SctpAssociation::streamSchedulerRandomPacket |
( |
SctpPathVariables * |
path, |
|
|
bool |
peek |
|
) |
| |
|
protected |
234 EV_DETAIL <<
"Stream Scheduler: again sid " << sid <<
".\n";
240 if (sid >= 0 && !peek)
248 int32_t sid = 0, testsid;
249 std::list<uint32_t> PriorityList;
250 std::list<uint32_t> StreamList;
252 EV_INFO <<
"Stream Scheduler: Priority (peek: " << peek <<
")" << endl;
261 EV_DETAIL <<
"Stream Scheduler: again sid " << sid <<
".\n";
Referenced by SctpAssociation().
◆ streamSchedulerRoundRobinPacket()
| int32_t inet::sctp::SctpAssociation::streamSchedulerRoundRobinPacket |
( |
SctpPathVariables * |
path, |
|
|
bool |
peek |
|
) |
| |
|
protected |
184 EV_DETAIL <<
"Stream Scheduler: again sid " << sid <<
".\n";
190 if (sid >= 0 && !peek)
198 EV_INFO <<
"Stream Scheduler: Random (peek: " << peek <<
")" << endl;
205 int32_t sid = -1, rnd;
207 std::vector<uint32_t> SctpWaitingSendStreamsList;
209 EV_INFO <<
"Stream Scheduler: RandomPacket (peek: " << peek <<
")" << endl;
213 if (elem.second->getUnorderedStreamQ()->getLength() > 0 ||
214 elem.second->getStreamQ()->getLength() > 0)
216 SctpWaitingSendStreamsList.push_back(elem.first);
217 EV_DETAIL <<
"Stream Scheduler: add sid " << elem.first <<
" to list of waiting streams.\n";
Referenced by SctpAssociation().
◆ timeForSack()
| void inet::sctp::SctpAssociation::timeForSack |
( |
bool & |
sackOnly, |
|
|
bool & |
sackWithData |
|
) |
| |
|
private |
249 sackOnly = sackWithData =
false;
258 sackOnly = sackWithData =
true;
261 sackOnly = sackWithData =
true;
Referenced by sendOnPath().
◆ transformDataChunk()
Manipulating chunks.
2088 SctpDataChunk *dataChunk =
new SctpDataChunk();
2089 SctpSimpleMessage *msg = check_and_cast<SctpSimpleMessage *>(chunk->userData->dup());
2090 dataChunk->setSctpChunkType(
DATA);
2091 dataChunk->setBBit(chunk->bbit);
2092 dataChunk->setEBit(chunk->ebit);
2093 if (chunk->ordered) {
2094 dataChunk->setUBit(0);
2097 dataChunk->setUBit(1);
2099 dataChunk->setTsn(chunk->tsn);
2100 dataChunk->setSid(chunk->sid);
2101 dataChunk->setSsn(chunk->ssn);
2102 dataChunk->setPpid(chunk->ppid);
2103 dataChunk->setIBit(chunk->ibit);
2104 dataChunk->setEnqueuingTime(chunk->enqueuingTime);
2105 dataChunk->setFirstSendTime(chunk->firstSendTime);
2107 msg->setByteLength(chunk->len / 8);
2108 dataChunk->encapsulate(msg);
2109 dataChunk->setLength(dataChunk->getByteLength());
Referenced by sendOnPath().
◆ tsnBetween()
| static bool inet::sctp::SctpAssociation::tsnBetween |
( |
const uint32_t |
tsn1, |
|
|
const uint32_t |
midtsn, |
|
|
const uint32_t |
tsn2 |
|
) |
| |
|
inlinestatic |
◆ tsnGe()
| static bool inet::sctp::SctpAssociation::tsnGe |
( |
const uint32_t |
tsn1, |
|
|
const uint32_t |
tsn2 |
|
) |
| |
|
inlinestatic |
◆ tsnGt()
| static bool inet::sctp::SctpAssociation::tsnGt |
( |
const uint32_t |
tsn1, |
|
|
const uint32_t |
tsn2 |
|
) |
| |
|
inlinestatic |
Referenced by inet::sctp::SctpSimpleGapList::check(), checkPseudoCumAck(), cwndUpdateAfterSack(), handleChunkReportedAsMissing(), makeRoomForTsn(), processDataArrived(), processInAndOutResetRequestArrived(), processOutgoingResetRequestArrived(), processSackArrived(), updateFastRecoveryStatus(), and inet::sctp::SctpSimpleGapList::updateGapList().
◆ tsnIsDuplicate()
| bool inet::sctp::SctpAssociation::tsnIsDuplicate |
( |
const uint32_t |
tsn | ) |
const |
|
protected |
Methods dealing with the handling of TSNs
2236 for (std::list<uint32_t>::const_iterator iterator =
state->
dupList.begin();
2239 if ((*iterator) == tsn)
Referenced by processDataArrived().
◆ tsnLe()
| static bool inet::sctp::SctpAssociation::tsnLe |
( |
const uint32_t |
tsn1, |
|
|
const uint32_t |
tsn2 |
|
) |
| |
|
inlinestatic |
◆ tsnLt()
| static bool inet::sctp::SctpAssociation::tsnLt |
( |
const uint32_t |
tsn1, |
|
|
const uint32_t |
tsn2 |
|
) |
| |
|
inlinestatic |
◆ tsnWasReneged()
914 (sackPath != chunk->ackedOnPath))
918 EV_INFO <<
"TSN " << chunk->tsn <<
" has been reneged (type "
919 <<
type <<
")" << endl;
921 if (chunk->countsAsOutstanding) {
924 chunk->hasBeenReneged =
true;
925 chunk->gapReports = 1;
926 if (!chunk->getLastDestinationPath()->T3_RtxTimer->isScheduled()) {
927 startTimer(chunk->getLastDestinationPath()->T3_RtxTimer,
928 chunk->getLastDestinationPath()->pathRto);
Referenced by handleChunkReportedAsMissing(), and processSackArrived().
◆ typeInChunkList()
| bool inet::sctp::SctpAssociation::typeInChunkList |
( |
uint16_t |
type | ) |
|
|
protected |
280 if ((elem) ==
type) {
Referenced by process_RCV_Message(), processPacketDropArrived(), retransmitCookieEcho(), sendAbort(), sendCookieAck(), sendCookieEcho(), sendHeartbeat(), sendHeartbeatAck(), sendInvalidStreamError(), sendSack(), and sendShutdown().
◆ typeInOwnChunkList()
| bool inet::sctp::SctpAssociation::typeInOwnChunkList |
( |
uint16_t |
type | ) |
|
|
protected |
◆ unackChunk()
◆ unorderedQueueEmptyOfStream()
| bool inet::sctp::SctpAssociation::unorderedQueueEmptyOfStream |
( |
uint16_t |
sid | ) |
|
|
protected |
◆ updateCounters()
3706 bool notifyUlp =
false;
3708 EV_DETAIL <<
"Retransmission count during connection setup exceeds " << (int32_t)
sctpMain->
getAssocMaxRtx() <<
", giving up\n";
3715 if (path->activePath) {
3720 path->activePath =
false;
3724 EV_DETAIL <<
"process_TIMEOUT_RESET(" << (path->remoteAddress) <<
") : PATH ERROR COUNTER EXCEEDED, path status is INACTIVE\n";
3726 EV_DETAIL <<
"process_TIMEOUT_RESET : ALL PATHS INACTIVE --> closing ASSOC\n";
3732 else if (notifyUlp) {
3736 EV_DETAIL <<
"process_TIMEOUT_RESET(" << (path->remoteAddress) <<
") : PATH ERROR COUNTER now " << path->pathErrorCount <<
"\n";
Referenced by process_TIMEOUT_ASCONF(), and process_TIMEOUT_RESET().
◆ updateFastRecoveryStatus()
| void inet::sctp::SctpAssociation::updateFastRecoveryStatus |
( |
uint32_t |
lastTsnAck | ) |
|
|
protected |
583 if (path->fastRecoveryActive) {
584 if ((
tsnGt(lastTsnAck, path->fastRecoveryExitPoint)) ||
586 ((path->newPseudoCumAck &&
tsnGt(path->pseudoCumAck, path->fastRecoveryExitPoint)) ||
587 (path->newRTXPseudoCumAck &&
tsnGt(path->rtxPseudoCumAck, path->fastRecoveryExitPoint)))))
589 path->fastRecoveryActive =
false;
590 path->fastRecoveryExitPoint = 0;
592 EV_INFO << simTime() <<
":\tCC [cwndUpdateAfterSack] Leaving Fast Recovery on path "
593 << path->remoteAddress
594 <<
", lastTsnAck=" << lastTsnAck
595 <<
", pseudoCumAck=" << path->pseudoCumAck
596 <<
", rtxPseudoCumAck=" << path->rtxPseudoCumAck
597 <<
", newPseudoCumAck=" << path->newPseudoCumAck
598 <<
", newRTXPseudoCumAck=" << path->newRTXPseudoCumAck
Referenced by processSackArrived().
◆ updateHighSpeedCCThresholdIdx()
| void inet::sctp::SctpAssociation::updateHighSpeedCCThresholdIdx |
( |
SctpPathVariables * |
path | ) |
|
|
private |
117 if (path->cwnd > HighSpeedCwndAdjustmentTable[path->highSpeedCCThresholdIdx].cwndThreshold * path->pmtu) {
119 && (path->cwnd > HighSpeedCwndAdjustmentTable[path->highSpeedCCThresholdIdx].cwndThreshold * path->pmtu))
121 path->highSpeedCCThresholdIdx++;
125 while ((path->highSpeedCCThresholdIdx > 0)
126 && (path->cwnd <= HighSpeedCwndAdjustmentTable[path->highSpeedCCThresholdIdx].cwndThreshold * path->pmtu))
128 path->highSpeedCCThresholdIdx--;
Referenced by cwndUpdateAfterSack(), and cwndUpdateBytesAcked().
◆ updateOLIA()
| uint32_t inet::sctp::SctpAssociation::updateOLIA |
( |
uint32_t |
w, |
|
|
uint32_t |
s, |
|
|
uint32_t |
totalW, |
|
|
double |
a, |
|
|
uint32_t |
mtu, |
|
|
uint32_t |
ackedBytes, |
|
|
SctpPathVariables * |
path |
|
) |
| |
|
private |
w: cwnd of the path s: ssthresh of the path totalW: Sum of all cwnds of the association a: factor alpha of olia calculation - see https://tools.ietf.org/html/draft-khalili-mptcp-congestion-control-05 mtu: mtu of the path ackedBytes: ackednowlged bytes path: path variable (for further investigation, debug, etc)
254 int32_t increase = 0;
255 bool isInCollectedPath =
false;
256 bool isMaxWndPaths =
false;
258 if ((!(w <
s)) && (!path->fastRecoveryActive)) {
266 if (it->second == path) {
267 isInCollectedPath =
true;
275 if (it->second == path) {
276 isMaxWndPaths =
true;
281 double r_sRTT = GET_SRTT(path->srtt.dbl());
283 double numerator1 = path->cwnd / (r_sRTT * r_sRTT);
284 double denominator1 = 0;
288 double p_sRTT = GET_SRTT(p_path->srtt.dbl());
289 denominator1 += (p_path->cwnd / p_sRTT);
291 denominator1 = denominator1 * denominator1;
292 double term1 = numerator1 / denominator1;
294 if (isInCollectedPath) {
309 if (denominator2 > 0.0) {
310 term2 = numerator2 / denominator2;
312 increase = (uint32_t)ceil(
313 (term1 * path->cwnd * path->pmtu) + (term2 * path->pmtu));
326 double numerator2 = 1.0 / (double)
sctpPathMap.size();
329 if (denominator2 > 0.0) {
330 term2 = numerator2 / denominator2;
332 increase = (int32_t)ceil(
333 (term1 * path->cwnd * path->pmtu) - (term2 * path->pmtu));
345 increase = (int32_t)ceil(term1 * path->cwnd * path->pmtu);
349 increase = (int32_t)
min(path->pmtu, ackedBytes);
Referenced by cwndUpdateBytesAcked().
◆ Sctp
◆ SctpPathVariables
◆ advMsgRwnd
| cOutVector* inet::sctp::SctpAssociation::advMsgRwnd |
◆ advRwnd
| cOutVector* inet::sctp::SctpAssociation::advRwnd |
|
protected |
◆ appGateIndex
| int32_t inet::sctp::SctpAssociation::appGateIndex |
◆ assocBestPaths
◆ assocCollectedPaths
◆ assocId
| int32_t inet::sctp::SctpAssociation::assocId |
Referenced by inet::sctp::Sctp::addForkedAssociation(), cloneAssociation(), createForwardTsnChunk(), createSack(), cwndUpdateAfterCwndTimeout(), cwndUpdateAfterRtxTimeout(), cwndUpdateAfterSack(), cwndUpdateBytesAcked(), cwndUpdateMaxBurst(), dequeueAckedChunks(), inet::sctp::Sctp::findAssocForFd(), fragmentOutboundDataMsgs(), generateSendQueueAbatedIndication(), handleChunkReportedAsAcked(), handleChunkReportedAsMissing(), inet::sctp::Sctp::handleMessage(), makeRoomForTsn(), pathStatusIndication(), printAssocBrief(), inet::sctp::Sctp::printInfoAssocMap(), process_ABORT(), process_ASSOCIATE(), process_CLOSE(), process_OPEN_PASSIVE(), process_RCV_Message(), process_SEND(), process_TIMEOUT_RTX(), processAddInAndOutResetRequestArrived(), processAppCommand(), processAsconfArrived(), processDataArrived(), processInitArrived(), processOutAndResponseArrived(), processResetResponseArrived(), processSackArrived(), processTimer(), pushUlp(), inet::sctp::Sctp::removeAssociation(), retransmitAsconf(), retransmitCookieEcho(), SctpAssociation(), inet::sctp::SctpPathVariables::SctpPathVariables(), sendAbort(), sendAddOutgoingStreamsRequest(), sendAsconf(), sendAsconfAck(), sendAvailableIndicationToApp(), sendCookieAck(), sendCookieEcho(), sendDataArrivedNotification(), sendEstabIndicationToApp(), sendHeartbeat(), sendHeartbeatAck(), sendIndicationToApp(), sendInvalidStreamError(), sendOnPath(), sendOutgoingRequestAndResponse(), sendSack(), sendSACKviaSelectedPath(), sendShutdown(), sendStreamResetRequest(), sendToApp(), sendToIP(), stateEntered(), inet::sctp::Sctp::updateSockPair(), and ~SctpAssociation().
◆ assocMaxWndPaths
◆ assocThroughputVector
| cOutVector* inet::sctp::SctpAssociation::assocThroughputVector |
◆ bytes
◆ ccFunctions
◆ ccModule
| uint16_t inet::sctp::SctpAssociation::ccModule |
|
protected |
◆ cumTsnAck
| cOutVector* inet::sctp::SctpAssociation::cumTsnAck |
|
protected |
◆ dacPacketsRcvd
| uint8_t inet::sctp::SctpAssociation::dacPacketsRcvd |
◆ EndToEndDelay
| cOutVector* inet::sctp::SctpAssociation::EndToEndDelay |
◆ FairStartTimer
| cMessage* inet::sctp::SctpAssociation::FairStartTimer |
◆ FairStopTimer
| cMessage* inet::sctp::SctpAssociation::FairStopTimer |
◆ fairTimer
| bool inet::sctp::SctpAssociation::fairTimer |
◆ fd
| int32_t inet::sctp::SctpAssociation::fd |
◆ fsm
| cFSM* inet::sctp::SctpAssociation::fsm |
|
protected |
Referenced by cloneAssociation(), performStateTransition(), printAssocBrief(), process_ABORT(), process_ASSOCIATE(), process_CLOSE(), process_OPEN_PASSIVE(), process_RCV_Message(), process_SEND(), process_STATUS(), process_TIMEOUT_INIT_REXMIT(), process_TIMEOUT_SHUTDOWN(), processAppCommand(), processCookieAckArrived(), processCookieEchoArrived(), processInitAckArrived(), processInitArrived(), processSctpMessage(), pushUlp(), retransmitReset(), SctpAssociation(), sendInitAck(), and ~SctpAssociation().
◆ ift
◆ inboundStreams
| uint32_t inet::sctp::SctpAssociation::inboundStreams |
|
protected |
Referenced by cloneAssociation(), initAssociation(), process_OPEN_PASSIVE(), process_RECEIVE_REQUEST(), processDataArrived(), processInitAckArrived(), processResetResponseArrived(), processStreamResetArrived(), pushUlp(), inet::sctp::Sctp::removeAssociation(), SctpAssociation(), sendEstabIndicationToApp(), sendInit(), and sendInitAck().
◆ initInboundStreams
| uint32_t inet::sctp::SctpAssociation::initInboundStreams |
|
protected |
◆ initPeerTsn
| uint32_t inet::sctp::SctpAssociation::initPeerTsn |
|
protected |
◆ initTsn
| uint32_t inet::sctp::SctpAssociation::initTsn |
|
protected |
◆ listening
| bool inet::sctp::SctpAssociation::listening |
◆ listeningAssocId
| int32_t inet::sctp::SctpAssociation::listeningAssocId |
◆ localAddr
| L3Address inet::sctp::SctpAssociation::localAddr |
Referenced by inet::sctp::Sctp::addLocalAddress(), inet::sctp::Sctp::addLocalAddressToAllRemoteAddresses(), cloneAssociation(), createSack(), generateSendQueueAbatedIndication(), printAssocBrief(), process_RCV_Message(), process_SEND(), processAsconfAckArrived(), processInitArrived(), processSctpMessage(), pushUlp(), resetExpectedSsn(), resetExpectedSsns(), resetSsn(), resetSsns(), retransmitCookieEcho(), retransmitReset(), retransmitShutdown(), retransmitShutdownAck(), sendAsconf(), sendAvailableIndicationToApp(), sendEstabIndicationToApp(), sendIndicationToApp(), sendInit(), sendInitAck(), and inet::sctp::Sctp::updateSockPair().
◆ localAddressList
◆ localPort
| uint16_t inet::sctp::SctpAssociation::localPort |
Referenced by inet::sctp::Sctp::addLocalAddress(), inet::sctp::Sctp::addLocalAddressToAllRemoteAddresses(), inet::sctp::Sctp::addRemoteAddress(), cloneAssociation(), printAssocBrief(), process_ASSOCIATE(), process_OPEN_PASSIVE(), processAddInAndOutResetRequestArrived(), processAsconfArrived(), processSctpMessage(), inet::sctp::Sctp::removeLocalAddressFromAllRemoteAddresses(), inet::sctp::Sctp::removeRemoteAddressFromAllAssociations(), SctpAssociation(), sendAbort(), sendAddInAndOutStreamsRequest(), sendAddOutgoingStreamsRequest(), sendAsconf(), sendAsconfAck(), sendAvailableIndicationToApp(), sendBundledOutgoingResetAndResponse(), sendCookieAck(), sendCookieEcho(), sendDoubleStreamResetResponse(), sendEstabIndicationToApp(), sendHeartbeat(), sendHeartbeatAck(), sendIndicationToApp(), sendInit(), sendInitAck(), sendOutgoingRequestAndResponse(), sendOutgoingResetRequest(), sendShutdown(), sendShutdownAck(), sendShutdownComplete(), sendStreamResetRequest(), sendStreamResetResponse(), sendToIP(), stateEntered(), and inet::sctp::Sctp::updateSockPair().
◆ localVTag
| uint32_t inet::sctp::SctpAssociation::localVTag |
◆ numberOfRemoteAddresses
| uint32_t inet::sctp::SctpAssociation::numberOfRemoteAddresses |
|
protected |
◆ numGapBlocks
| cOutVector* inet::sctp::SctpAssociation::numGapBlocks |
|
protected |
◆ outboundStreams
| uint32_t inet::sctp::SctpAssociation::outboundStreams |
|
protected |
Referenced by cloneAssociation(), initAssociation(), process_OPEN_PASSIVE(), process_STREAM_RESET(), processIncomingResetRequestArrived(), processInitAckArrived(), processResetResponseArrived(), processStreamResetArrived(), SctpAssociation(), sendEstabIndicationToApp(), sendInit(), sendInitAck(), and streamSchedulerPriority().
◆ peerVTag
| uint32_t inet::sctp::SctpAssociation::peerVTag |
◆ qCounter
Referenced by addPath(), bytesAllowedToSend(), choosePathForRetransmission(), createForwardTsnChunk(), decreaseOutstandingBytes(), dequeueOutboundDataMsg(), fragmentOutboundDataMsgs(), getAllTransQ(), getOutboundDataChunk(), handleChunkReportedAsMissing(), increaseOutstandingBytes(), loadPacket(), makeRoomForTsn(), moveChunkToOtherPath(), nonRenegablyAckChunk(), process_RCV_Message(), process_SEND(), processInitAckArrived(), processInitArrived(), processSackArrived(), pushUlp(), putInDeliveryQ(), putInTransmissionQ(), renegablyAckChunk(), SctpAssociation(), sendBundledOutgoingResetAndResponse(), sendDoubleStreamResetResponse(), sendInit(), sendOnAllPaths(), sendOnPath(), sendOutgoingResetRequest(), sendStreamResetRequest(), sendStreamResetResponse(), stateEntered(), and storePacket().
◆ receiveStreams
Referenced by calculateRcvBuffer(), getExpectedSsnOfStream(), initStreams(), listOrderedQ(), makeRoomForTsn(), processDataArrived(), processForwardTsnArrived(), pushUlp(), putInDeliveryQ(), receiveStreamPresent(), resetExpectedSsn(), and resetExpectedSsns().
◆ remoteAddr
| L3Address inet::sctp::SctpAssociation::remoteAddr |
Referenced by inet::sctp::Sctp::addLocalAddress(), createSack(), generateSendQueueAbatedIndication(), performStateTransition(), printAssocBrief(), process_CLOSE(), process_RCV_Message(), process_SEND(), process_STATUS(), process_STREAM_RESET(), processAddInAndOutResetRequestArrived(), processAppCommand(), processAsconfAckArrived(), processAsconfArrived(), processDataArrived(), processInitAckArrived(), processInitArrived(), processOutAndResponseArrived(), processOutgoingResetRequestArrived(), processPacketDropArrived(), processResetResponseArrived(), processSackArrived(), processSctpMessage(), pushUlp(), retransmitCookieEcho(), retransmitReset(), retransmitShutdown(), retransmitShutdownAck(), sendAbort(), sendAddInAndOutStreamsRequest(), sendAddOutgoingStreamsRequest(), sendAsconf(), sendAsconfAck(), sendAvailableIndicationToApp(), sendBundledOutgoingResetAndResponse(), sendDoubleStreamResetResponse(), sendEstabIndicationToApp(), sendIndicationToApp(), sendInit(), sendInitAck(), sendOutgoingRequestAndResponse(), sendOutgoingResetRequest(), sendPacketDrop(), sendShutdown(), sendStreamResetRequest(), sendStreamResetResponse(), stateEntered(), and inet::sctp::Sctp::updateSockPair().
◆ remoteAddressList
◆ remotePort
| uint16_t inet::sctp::SctpAssociation::remotePort |
Referenced by inet::sctp::Sctp::addLocalAddress(), inet::sctp::Sctp::addLocalAddressToAllRemoteAddresses(), inet::sctp::Sctp::addRemoteAddress(), printAssocBrief(), process_ASSOCIATE(), processAddInAndOutResetRequestArrived(), processAsconfArrived(), processSctpMessage(), inet::sctp::Sctp::removeLocalAddressFromAllRemoteAddresses(), inet::sctp::Sctp::removeRemoteAddressFromAllAssociations(), SctpAssociation(), sendAbort(), sendAddInAndOutStreamsRequest(), sendAddOutgoingStreamsRequest(), sendAsconf(), sendAsconfAck(), sendAvailableIndicationToApp(), sendBundledOutgoingResetAndResponse(), sendCookieAck(), sendCookieEcho(), sendDoubleStreamResetResponse(), sendEstabIndicationToApp(), sendHeartbeat(), sendHeartbeatAck(), sendIndicationToApp(), sendInit(), sendInitAck(), sendOutgoingRequestAndResponse(), sendOutgoingResetRequest(), sendShutdown(), sendShutdownAck(), sendShutdownComplete(), sendStreamResetRequest(), sendStreamResetResponse(), sendToIP(), stateEntered(), and inet::sctp::Sctp::updateSockPair().
◆ retransmissionQ
| SctpQueue* inet::sctp::SctpAssociation::retransmissionQ |
|
protected |
Referenced by advancePeerTsn(), checkPseudoCumAck(), chunkReschedulingControl(), cloneAssociation(), createForwardTsnChunk(), cwndUpdateAfterSack(), dequeueAckedChunks(), initAssociation(), loadPacket(), nonRenegablyAckChunk(), peekAbandonedChunk(), process_TIMEOUT_RTX(), processPacketDropArrived(), processSackArrived(), SctpAssociation(), sendOnPath(), and storePacket().
◆ rt
Referenced by addPath(), cloneAssociation(), pmStartPathManagement(), processAddInAndOutResetRequestArrived(), processInitAckArrived(), processInitArrived(), SctpAssociation(), sendAddInAndOutStreamsRequest(), sendAddOutgoingStreamsRequest(), sendBundledOutgoingResetAndResponse(), sendInit(), sendOutgoingRequestAndResponse(), sendOutgoingResetRequest(), and sendStreamResetRequest().
◆ sackFrequency
| uint32_t inet::sctp::SctpAssociation::sackFrequency |
|
protected |
◆ sackPeriod
| double inet::sctp::SctpAssociation::sackPeriod |
|
protected |
◆ SackTimer
| cMessage* inet::sctp::SctpAssociation::SackTimer |
Referenced by processInitArrived(), processTimer(), inet::sctp::Sctp::removeAssociation(), scheduleSack(), SctpAssociation(), sendInvalidStreamError(), sendOnPath(), sendSack(), sendStreamResetResponse(), timeForSack(), and ~SctpAssociation().
◆ sctpAlgorithm
◆ sctpMain
| Sctp* inet::sctp::SctpAssociation::sctpMain |
|
protected |
Referenced by chunkReschedulingControl(), cloneAssociation(), createForwardTsnChunk(), createSack(), dequeueAckedChunks(), fragmentOutboundDataMsgs(), generateSendQueueAbatedIndication(), handleChunkReportedAsAcked(), handleChunkReportedAsMissing(), initAssociation(), makeRoomForTsn(), pathStatusIndication(), performStateTransition(), pmDataIsSentOn(), pmRttMeasurement(), pmStartPathManagement(), process_ASSOCIATE(), process_OPEN_PASSIVE(), process_RCV_Message(), process_SEND(), process_TIMEOUT_ASCONF(), process_TIMEOUT_HEARTBEAT(), process_TIMEOUT_HEARTBEAT_INTERVAL(), process_TIMEOUT_INIT_REXMIT(), process_TIMEOUT_RESET(), process_TIMEOUT_RTX(), process_TIMEOUT_SHUTDOWN(), processAddInAndOutResetRequestArrived(), processAppCommand(), processAsconfAckArrived(), processAsconfArrived(), processCookieEchoArrived(), processDataArrived(), processErrorArrived(), processHeartbeatAckArrived(), processInitAckArrived(), processInitArrived(), processOutAndResponseArrived(), processResetResponseArrived(), processSackArrived(), processTimer(), pushUlp(), retransmitAsconf(), retransmitCookieEcho(), SctpAssociation(), sendAbort(), sendAddOutgoingStreamsRequest(), sendAsconf(), sendAsconfAck(), sendAvailableIndicationToApp(), sendCookieAck(), sendCookieEcho(), sendEstabIndicationToApp(), sendHeartbeat(), sendHeartbeatAck(), sendIndicationToApp(), sendInit(), sendInitAck(), sendInvalidStreamError(), sendOnPath(), sendOutgoingRequestAndResponse(), sendPacketDrop(), sendSack(), sendShutdown(), sendStreamResetRequest(), sendToApp(), sendToIP(), stateEntered(), and updateCounters().
◆ sctpPathMap
Referenced by addPath(), allPathsInactive(), choosePathForRetransmission(), chunkReschedulingControl(), cwndUpdateAfterSack(), cwndUpdateBeforeSack(), getInitialCwnd(), getNextPath(), getOutstandingBytes(), getSortedPathMap(), handleChunkReportedAsMissing(), pmStartPathManagement(), printSctpPathMap(), processInitAckArrived(), processInitArrived(), processSackArrived(), recalculateOLIABasis(), recordCwndUpdate(), inet::sctp::Sctp::removeAssociation(), removePath(), sendInit(), sendOnAllPaths(), sendOnPath(), stateEntered(), stopTimers(), updateFastRecoveryStatus(), and updateOLIA().
◆ sendQueue
| cOutVector* inet::sctp::SctpAssociation::sendQueue |
|
protected |
◆ sendStreams
Referenced by decreaseOutstandingBytes(), dequeueOutboundDataMsg(), fragmentOutboundDataMsgs(), generateSendQueueAbatedIndication(), getBytesInFlightOfStream(), getFragInProgressOfStream(), getSsnOfStream(), increaseOutstandingBytes(), makeDataVarFromDataMsg(), nextChunkFitsIntoPacket(), nonRenegablyAckChunk(), orderedQueueEmptyOfStream(), process_SEND(), resetSsn(), resetSsns(), sendStreamPresent(), setFragInProgressOfStream(), streamSchedulerPriority(), and unorderedQueueEmptyOfStream().
◆ ssFunctions
◆ ssModule
| uint16_t inet::sctp::SctpAssociation::ssModule |
|
protected |
◆ StartAddIP
| cMessage* inet::sctp::SctpAssociation::StartAddIP |
◆ StartTesting
| cMessage* inet::sctp::SctpAssociation::StartTesting |
◆ state
Referenced by addOutStreams(), advancePeerTsn(), bytesAllowedToSend(), calculateAssocSharedKey(), calculateRcvBuffer(), checkStreamsToReset(), chunkReschedulingControl(), cloneAssociation(), compareRandom(), createForwardTsnChunk(), createSack(), cucProcessGapReports(), cwndUpdateAfterRtxTimeout(), cwndUpdateAfterSack(), cwndUpdateBytesAcked(), cwndUpdateMaxBurst(), decreaseOutstandingBytes(), dequeueOutboundDataMsg(), fragmentOutboundDataMsgs(), generateSendQueueAbatedIndication(), getInitialCwnd(), getNextDestination(), getNextPath(), getSortedPathMap(), handleChunkReportedAsAcked(), handleChunkReportedAsMissing(), increaseOutstandingBytes(), initAssociation(), initCcParameters(), initStreams(), loadPacket(), makeAddStreamsRequestParameter(), makeDataVarFromDataMsg(), makeIncomingStreamResetParameter(), makeOutgoingStreamResetParameter(), makeRoomForTsn(), makeSsnTsnResetParameter(), makeVarFromMsg(), moveChunkToOtherPath(), nextChunkFitsIntoPacket(), nonRenegablyAckChunk(), peekAbandonedChunk(), performStateTransition(), pmClearPathCounter(), pmDataIsSentOn(), pmStartPathManagement(), process_ABORT(), process_ASSOCIATE(), process_CLOSE(), process_OPEN_PASSIVE(), process_PRIMARY(), process_QUEUE_BYTES_LIMIT(), process_QUEUE_MSGS_LIMIT(), process_RCV_Message(), process_RECEIVE_REQUEST(), process_SEND(), process_STREAM_RESET(), process_TIMEOUT_HEARTBEAT(), process_TIMEOUT_HEARTBEAT_INTERVAL(), process_TIMEOUT_INIT_REXMIT(), process_TIMEOUT_RESET(), process_TIMEOUT_RTX(), process_TIMEOUT_SHUTDOWN(), processAddInAndOutResetRequestArrived(), processAppCommand(), processAsconfAckArrived(), processAsconfArrived(), processCookieAckArrived(), processCookieEchoArrived(), processDataArrived(), processErrorArrived(), processForwardTsnArrived(), processHeartbeatAckArrived(), processInAndOutResetRequestArrived(), processIncomingResetRequestArrived(), processInitAckArrived(), processInitArrived(), processOutAndResponseArrived(), processOutgoingResetRequestArrived(), processPacketDropArrived(), processResetResponseArrived(), processSackArrived(), processSctpMessage(), processSsnTsnResetRequestArrived(), processStreamResetArrived(), processTimer(), pushUlp(), putInDeliveryQ(), inet::sctp::Sctp::removeAssociation(), renegablyAckChunk(), resetGapLists(), retransmitAsconf(), retransmitCookieEcho(), retransmitInit(), retransmitReset(), retransmitShutdown(), retransmitShutdownAck(), rpPathBlockingControl(), scheduleSack(), SctpAssociation(), sendAbort(), sendAddInAndOutStreamsRequest(), sendAddOutgoingStreamsRequest(), sendAsconf(), sendAsconfAck(), sendBundledOutgoingResetAndResponse(), sendCookieAck(), sendCookieEcho(), sendDoubleStreamResetResponse(), sendEstabIndicationToApp(), sendHeartbeat(), sendHeartbeatAck(), sendInit(), sendInitAck(), sendInvalidStreamError(), sendOnAllPaths(), sendOnPath(), sendOutgoingRequestAndResponse(), sendOutgoingResetRequest(), sendPacketDrop(), sendSack(), sendSACKviaSelectedPath(), sendShutdown(), sendShutdownAck(), sendStreamResetRequest(), sendStreamResetResponse(), stateEntered(), stateName(), storePacket(), streamIsPending(), streamSchedulerFairBandwidthPacket(), streamSchedulerPriority(), streamSchedulerRandom(), timeForSack(), tsnIsDuplicate(), tsnWasReneged(), typeInChunkList(), typeInOwnChunkList(), updateCounters(), updateFastRecoveryStatus(), and ~SctpAssociation().
◆ statisticsArwndInLastSACK
| cOutVector* inet::sctp::SctpAssociation::statisticsArwndInLastSACK |
|
protected |
◆ statisticsNonRevokableGapBlocksInLastSACK
| cOutVector* inet::sctp::SctpAssociation::statisticsNonRevokableGapBlocksInLastSACK |
|
protected |
◆ statisticsNumDuplicatesSent
| cOutVector* inet::sctp::SctpAssociation::statisticsNumDuplicatesSent |
|
protected |
◆ statisticsNumDuplicatesStored
| cOutVector* inet::sctp::SctpAssociation::statisticsNumDuplicatesStored |
|
protected |
◆ statisticsNumNonRevokableGapBlocksSent
| cOutVector* inet::sctp::SctpAssociation::statisticsNumNonRevokableGapBlocksSent |
|
protected |
◆ statisticsNumNonRevokableGapBlocksStored
| cOutVector* inet::sctp::SctpAssociation::statisticsNumNonRevokableGapBlocksStored |
|
protected |
◆ statisticsNumRevokableGapBlocksSent
| cOutVector* inet::sctp::SctpAssociation::statisticsNumRevokableGapBlocksSent |
|
protected |
◆ statisticsNumRevokableGapBlocksStored
| cOutVector* inet::sctp::SctpAssociation::statisticsNumRevokableGapBlocksStored |
|
protected |
◆ statisticsNumTotalGapBlocksStored
| cOutVector* inet::sctp::SctpAssociation::statisticsNumTotalGapBlocksStored |
|
protected |
◆ statisticsOutstandingBytes
| cOutVector* inet::sctp::SctpAssociation::statisticsOutstandingBytes |
|
protected |
◆ statisticsPeerRwnd
| cOutVector* inet::sctp::SctpAssociation::statisticsPeerRwnd |
|
protected |
◆ statisticsQueuedReceivedBytes
| cOutVector* inet::sctp::SctpAssociation::statisticsQueuedReceivedBytes |
|
protected |
◆ statisticsQueuedSentBytes
| cOutVector* inet::sctp::SctpAssociation::statisticsQueuedSentBytes |
|
protected |
◆ statisticsRevokableGapBlocksInLastSACK
| cOutVector* inet::sctp::SctpAssociation::statisticsRevokableGapBlocksInLastSACK |
|
protected |
◆ statisticsSACKLengthSent
| cOutVector* inet::sctp::SctpAssociation::statisticsSACKLengthSent |
|
protected |
◆ statisticsTotalBandwidth
| cOutVector* inet::sctp::SctpAssociation::statisticsTotalBandwidth |
|
protected |
◆ statisticsTotalCwnd
| cOutVector* inet::sctp::SctpAssociation::statisticsTotalCwnd |
|
protected |
◆ statisticsTotalSSthresh
| cOutVector* inet::sctp::SctpAssociation::statisticsTotalSSthresh |
|
protected |
◆ status
| int32_t inet::sctp::SctpAssociation::status |
|
protected |
◆ streamThroughputVectors
| std::map<uint16_t, cOutVector *> inet::sctp::SctpAssociation::streamThroughputVectors |
◆ T1_InitTimer
| cMessage* inet::sctp::SctpAssociation::T1_InitTimer |
Referenced by process_ASSOCIATE(), process_TIMEOUT_INIT_REXMIT(), processCookieAckArrived(), processInitAckArrived(), processInitArrived(), processPacketDropArrived(), processTimer(), inet::sctp::Sctp::removeAssociation(), SctpAssociation(), stateEntered(), and ~SctpAssociation().
◆ T2_ShutdownTimer
| cMessage* inet::sctp::SctpAssociation::T2_ShutdownTimer |
◆ T5_ShutdownGuardTimer
| cMessage* inet::sctp::SctpAssociation::T5_ShutdownGuardTimer |
◆ transmissionQ
| SctpQueue* inet::sctp::SctpAssociation::transmissionQ |
|
protected |
Referenced by cloneAssociation(), createForwardTsnChunk(), getOutboundDataChunk(), handleChunkReportedAsMissing(), initAssociation(), moveChunkToOtherPath(), nonRenegablyAckChunk(), process_RCV_Message(), putInTransmissionQ(), renegablyAckChunk(), SctpAssociation(), sendOnPath(), and stateEntered().
The documentation for this class was generated from the following files:
@ SCTP_E_RCV_INIT
Definition: SctpAssociation.h:68
@ FAIR_BANDWITH
Definition: SctpAssociation.h:195
std::map< uint32_t, RequestData > requests
Definition: SctpAssociation.h:795
@ SCTP_I_RCV_STREAMS_RESETTED
Definition: SctpCommand_m.h:214
@ SCTP_C_STREAM_RESET
Definition: SctpCommand_m.h:144
SctpEventCode processStreamResetArrived(SctpStreamResetChunk *strResChunk)
Definition: SctpAssociationRcvMessage.cc:2811
#define CHK(x)
Definition: INETDefs.h:87
cOutVector * statisticsOutstandingBytes
Definition: SctpAssociation.h:964
bool streamReset
Definition: SctpAssociation.h:774
bool zeroWindowProbing
Definition: SctpAssociation.h:572
@ UNSPECIFIED
Definition: Ipv6Address.h:43
@ SCTP_S_SHUTDOWN_PENDING
Definition: SctpAssociation.h:51
cOutVector * statisticsQueuedReceivedBytes
Definition: SctpAssociation.h:965
cOutVector * statisticsNumTotalGapBlocksStored
Definition: SctpAssociation.h:976
SctpDataVariables * makeDataVarFromDataMsg(SctpDataMsg *datMsg, SctpPathVariables *path)
Definition: SctpAssociationSendAll.cc:176
cMessage * FairStartTimer
Definition: SctpAssociation.h:921
void setInterfaceId(int id)
Definition: Sctp.h:272
SctpDataChunk * transformDataChunk(SctpDataVariables *chunk)
Manipulating chunks.
Definition: SctpAssociationUtil.cc:2086
#define SCTP_SSN_GT(a, b)
Definition: SctpAssociation.h:1073
bool tryToAdvanceCumAckTsn()
Definition: SctpGapList.cc:337
@ SCTP_C_SEND_UNORDERED
Definition: SctpCommand_m.h:138
#define HIGHSPEED_ENTRIES
Definition: SctpCcFunctions.cc:22
virtual void processTimer(cMessage *timer, SctpEventCode &event)=0
void retransmitCookieEcho()
Definition: SctpAssociationUtil.cc:1002
void processAddInAndOutResetRequestArrived(const SctpAddStreamsRequestParameter *addInRequestParam, SctpAddStreamsRequestParameter *addOutRequestParam)
Definition: SctpAssociationRcvMessage.cc:2693
@ SCTP_E_RCV_SHUTDOWN_COMPLETE
Definition: SctpAssociation.h:75
static bool SCTP_UINT32_GT(uint32_t a, uint32_t b)
Definition: SctpAssociation.h:1065
SctpEventCode processAsconfAckArrived(SctpAsconfAckChunk *asconfAckChunk)
Definition: SctpAssociationRcvMessage.cc:3304
uint32_t maxBurst
Definition: SctpAssociation.h:681
QueueCounter qCounter
Definition: SctpAssociation.h:956
@ SCTP_C_SEND_ASCONF
Definition: SctpCommand_m.h:148
SctpEventCode processForwardTsnArrived(SctpForwardTsnChunk *forChunk)
Definition: SctpAssociationRcvMessage.cc:2068
@ SCTP_I_SENDSOCKETOPTIONS
Definition: SctpCommand_m.h:217
SctpPathVariables * getNextDestination(SctpDataVariables *chunk) const
Definition: SctpAssociationUtil.cc:2696
SctpDataMsg * dequeueOutboundDataMsg(SctpPathVariables *path, int32_t availableSpace, int32_t availableCwnd)
Definition: SctpAssociationUtil.cc:2557
@ SCTP_E_TIMEOUT_HEARTBEAT_TIMER
Definition: SctpAssociation.h:80
uint32_t getInt() const
Returns the address as an uint32_t in host byte order (e.g.
Definition: Ipv4Address.h:186
@ CCRV_Test
Definition: SctpAssociation.h:719
int16_t initRetransCounter
Counter for init and cookie retransmissions.
Definition: SctpAssociation.h:639
uint16_t localPort
Definition: SctpAssociation.h:904
@ CCRV_ReceiverOnly
Definition: SctpAssociation.h:717
double getRtoInitial()
Definition: Sctp.h:257
uint32_t nextTsn
Definition: SctpAssociation.h:603
static bool tsnGt(const uint32_t tsn1, const uint32_t tsn2)
Definition: SctpAssociation.h:1076
#define SCTP_ADD_IP_PARAMETER_LENGTH
Definition: SctpAssociation.h:223
bool disableReneging
Definition: SctpAssociation.h:676
const value< double, compose< units::m, pow< units::s, -1 > > > c(299792458)
uint64_t numPktDropReports
Definition: Sctp.h:204
@ SCTP_E_RECEIVE
Definition: SctpAssociation.h:82
@ MBV_TotalMaxBurst
Definition: SctpAssociation.h:689
void processOutgoingResetRequestArrived(SctpOutgoingSsnResetRequestParameter *requestParam)
Definition: SctpAssociationRcvMessage.cc:2312
@ MBV_CongestionWindowLimiting
Definition: SctpAssociation.h:684
int32_t appGateIndex
Definition: SctpAssociation.h:897
@ SCTP_E_RCV_COOKIE_ACK
Definition: SctpAssociation.h:72
uint32_t nextRSid
Definition: SctpAssociation.h:652
void(SctpAssociation::* ccUpdateAfterCwndTimeout)(SctpPathVariables *path)
Definition: SctpAssociation.h:882
void bytesAllowedToSend(SctpPathVariables *path, bool firstPass)
Definition: SctpAssociationSendAll.cc:547
bool allPathsInactive() const
Definition: SctpAssociationUtil.cc:2864
uint32_t updateOLIA(uint32_t w, uint32_t s, uint32_t totalW, double a, uint32_t mtu, uint32_t ackedBytes, SctpPathVariables *path)
w: cwnd of the path s: ssthresh of the path totalW: Sum of all cwnds of the association a: factor alp...
Definition: SctpCcFunctions.cc:251
bool cmtMovedChunksReduceCwnd
Definition: SctpAssociation.h:731
@ GLOV_Optimized1
Definition: SctpAssociation.h:670
bool pktDropSent
Definition: SctpAssociation.h:823
void(SctpAssociation::* ccInitParams)(SctpPathVariables *path)
Definition: SctpAssociation.h:879
void sendSack()
Definition: SctpAssociationUtil.cc:1830
@ SCTP_S_ESTABLISHED
Definition: SctpAssociation.h:50
int32_t streamSchedulerRoundRobinPacket(SctpPathVariables *path, bool peek)
Definition: SctpSsFunctions.cc:174
@ SCTP_E_RCV_SHUTDOWN
Definition: SctpAssociation.h:73
void retransmitShutdownAck()
Definition: SctpAssociationUtil.cc:1229
SctpInitChunk * initChunk
pointer to the init chunk data structure (for retransmissions)
Definition: SctpAssociation.h:642
void generateSendQueueAbatedIndication(uint64_t bytes)
Definition: SctpAssociationRcvMessage.cc:1990
static const char * indicationName(int32_t code)
Utility: returns name of SCTP_I_xxx constants.
Definition: SctpAssociationUtil.cc:205
void sendOutgoingRequestAndResponse(uint32_t inRequestSn, uint32_t outRequestSn)
Definition: SctpAssociationStreamReset.cc:409
uint32_t getExpectedSsnOfStream(uint16_t id)
Definition: SctpAssociationStreamReset.cc:900
uint32_t peerVTag
Definition: SctpAssociation.h:907
@ SET_PRIMARY_ADDRESS
Definition: SctpAssociation.h:159
@ ROUND_ROBIN_PACKET
Definition: SctpAssociation.h:192
SctpParameter * makeIncomingStreamResetParameter(uint32_t srsn, SctpResetReq *info)
Definition: SctpAssociationStreamReset.cc:357
int32_t assocId
Definition: SctpAssociation.h:898
uint32_t pathErrorCount
Definition: SctpAssociation.h:290
@ CCRV_BothSides
Definition: SctpAssociation.h:718
void retransmitReset()
Definition: SctpAssociationStreamReset.cc:15
void resetExpectedSsn(uint16_t id)
Definition: SctpAssociationStreamReset.cc:892
@ ADD_INCOMING
Definition: SctpAssociation.h:145
@ SCTP_S_SHUTDOWN_RECEIVED
Definition: SctpAssociation.h:53
bool fastRecoverySupported
Definition: SctpAssociation.h:574
bool authAdded
Definition: SctpAssociation.h:663
@ RANDOM
Definition: SctpAssociation.h:174
static bool pathMapLargestSpaceAndSSThreshold(const SctpPathVariables *left, const SctpPathVariables *right)
Definition: SctpAssociationSendAll.cc:165
void processErrorArrived(SctpErrorChunk *error)
Definition: SctpAssociationRcvMessage.cc:3518
@ ADD_BOTH
Definition: SctpAssociation.h:153
SctpDataVariables * getChunk(const uint32_t key) const
Definition: SctpQueue.cc:111
void process_ABORT(SctpEventCode &event)
Definition: SctpAssociationEventProc.cc:429
uint32_t rtxMethod
Definition: SctpAssociation.h:679
uint64_t roomSumRcvStreams
Definition: SctpAssociation.h:866
@ SCTP_I_CLOSED
Definition: SctpCommand_m.h:201
cOutVector * statisticsSACKLengthSent
Definition: SctpAssociation.h:983
int32_t pathStreamSchedulerManual(SctpPathVariables *path, bool peek)
Definition: SctpSsFunctions.cc:472
@ SCTP_C_OPEN_PASSIVE
Definition: SctpCommand_m.h:131
cMessage * cancelEvent(cMessage *msg)
Utility: cancel a timer.
Definition: SctpAssociation.h:1191
uint32_t inRequestSn
Definition: SctpAssociation.h:785
uint32_t incomingSackSeqNum
Definition: SctpAssociation.h:764
PayloadQueue payloadQueue
Definition: SctpQueue.h:88
bool addRemoteAddress(SctpAssociation *assoc, L3Address localAddress, L3Address remoteAddress)
Definition: Sctp.cc:781
@ SCTP_E_SHUTDOWN
Definition: SctpAssociation.h:65
void process_QUEUE_MSGS_LIMIT(const SctpCommandReq *sctpCommand)
Queue Management.
Definition: SctpAssociationEventProc.cc:400
@ FORWARD_TSN
Definition: SctpAssociation.h:120
#define SCTP_FORWARD_TSN_CHUNK_LENGTH
Definition: SctpAssociation.h:211
double getRtoMax()
Definition: Sctp.h:259
@ SCTP_I_SENDQUEUE_FULL
Definition: SctpCommand_m.h:210
virtual size_t getCookieArraySize() const
void sendHeartbeat(const SctpPathVariables *path)
Definition: SctpAssociationUtil.cc:1024
bool appSendAllowed
Definition: SctpAssociation.h:650
bool inOut
Definition: SctpAssociation.h:589
static bool pathMapRandomized(const SctpPathVariables *left, const SctpPathVariables *right)
Definition: SctpAssociationSendAll.cc:143
uint32_t gapReportLimit
Definition: SctpAssociation.h:667
@ ROUND_ROBIN
Definition: SctpAssociation.h:191
@ LINK
Definition: Ipv6Address.h:46
#define SCTP_DEFAULT_OUTBOUND_STREAMS
Definition: SctpAssociation.h:230
int getPathMaxRetrans()
Definition: Sctp.h:266
uint64_t bookedSumSendStreams
Definition: SctpAssociation.h:865
@ SCTP_E_QUEUE_MSGS_LIMIT
Definition: SctpAssociation.h:86
cMessage * SackTimer
Definition: SctpAssociation.h:913
@ SCTP_C_PRIMARY
Definition: SctpCommand_m.h:139
void cwndUpdateAfterCwndTimeout(SctpPathVariables *path)
Definition: SctpCcFunctions.cc:978
uint32_t sizePeerKeyVector
Definition: SctpAssociation.h:817
@ CSP_SmallestSRTT
Definition: SctpAssociation.h:739
bool firstDataSent
Definition: SctpAssociation.h:584
double movedChunkFastRTXFactor
Definition: SctpAssociation.h:732
bool ssNextStream
Definition: SctpAssociation.h:842
bool peerPktDrop
Definition: SctpAssociation.h:824
uint32_t getInitialCwnd(const SctpPathVariables *path) const
Definition: SctpCcFunctions.cc:377
void printSctpPathMap() const
Definition: SctpAssociationUtil.cc:129
bool enableHeartbeats
Definition: SctpAssociation.h:655
@ SCTP_I_RESET_REQUEST_FAILED
Definition: SctpCommand_m.h:215
simtime_t testTimeout
Definition: Sctp.h:196
CounterMap roomRetransQ
Definition: SctpAssociation.h:869
int getFragPoint()
Definition: Sctp.h:263
double getRtoMin()
Definition: Sctp.h:258
@ LOOPBACK
Definition: Ipv6Address.h:44
uint64_t localRwnd
Definition: SctpAssociation.h:602
uint16_t header
Definition: SctpAssociation.h:631
int32_t streamSchedulerRandomPacket(SctpPathVariables *path, bool peek)
Definition: SctpSsFunctions.cc:227
virtual SctpShutdownAckChunk * dup() const override
Definition: SctpHeader_m.h:1357
SctpEventCode
Definition: SctpAssociation.h:61
void sendInvalidStreamError(uint16_t sid)
Definition: SctpAssociationUtil.cc:1869
#define RNGCONTEXT
Definition: INETDefs.h:82
void process_QUEUE_BYTES_LIMIT(const SctpCommandReq *sctpCommand)
Definition: SctpAssociationEventProc.cc:406
double getSackPeriod()
Definition: Sctp.h:261
void pmClearPathCounter(SctpPathVariables *path)
Definition: SctpAssociationUtil.cc:2808
uint32_t lastTsn
Definition: SctpAssociation.h:607
void resetGapLists()
Definition: SctpAssociationStreamReset.cc:748
@ IETF
Definition: Ipv4Address.h:79
@ UNSPECIFIED
Definition: Ipv4Address.h:74
uint32_t ackState
Definition: SctpAssociation.h:608
@ ADD_IP_ADDRESS
Definition: SctpAssociation.h:162
simtime_t lastAssocThroughputTime
Definition: SctpAssociation.h:839
@ PKTDROP
Definition: SctpAssociation.h:118
void printInfoAssocMap()
Definition: Sctp.cc:37
void findEarliestOutstandingTsnsForPath(const L3Address &remoteAddress, uint32_t &earliestOutstandingTsn, uint32_t &rtxEarliestOutstandingTsn) const
Definition: SctpQueue.cc:195
void sendStreamResetResponse(uint32_t srrsn, int result)
Definition: SctpAssociationStreamReset.cc:798
@ ERROR_CAUSE_INDICATION
Definition: SctpAssociation.h:164
@ SCTP_E_STREAM_RESET
Definition: SctpAssociation.h:91
void process_TIMEOUT_INIT_REXMIT(SctpEventCode &event)
Definition: SctpAssociationRcvMessage.cc:3544
static bool pathMapLargestSSThreshold(const SctpPathVariables *left, const SctpPathVariables *right)
Definition: SctpAssociationSendAll.cc:153
@ RESET_INCOMING
Definition: SctpAssociation.h:142
void(SctpAssociation::* ccUpdateAfterRtxTimeout)(SctpPathVariables *path)
Definition: SctpAssociation.h:883
SctpEventCode preanalyseAppCommandEvent(int32_t commandCode)
Maps app command codes (msg kind of app command msgs) to SCTP_E_xxx event codes.
Definition: SctpAssociationBase.cc:996
CounterMap roomTransQ
Definition: SctpAssociation.h:867
uint16_t numberAsconfReceived
Definition: SctpAssociation.h:768
bool firstChunkReceived
Definition: SctpAssociation.h:569
int count(const std::vector< T > &v, const Tk &a)
Definition: stlutils.h:54
std::map< uint16_t, uint32_t > streamThroughput
Definition: SctpAssociation.h:838
virtual SctpStreamResetChunk * dup() const override
Definition: SctpHeader.h:139
simtime_t lastSendQueueAbated
Definition: SctpAssociation.h:651
void sendDataArrivedNotification(uint16_t sid)
Definition: SctpAssociationUtil.cc:1855
uint64_t peerRwnd
Definition: SctpAssociation.h:600
SctpDataVariables * getAndExtractChunk(const uint32_t tsn)
Definition: SctpQueue.cc:65
@ PERFORMED_WITH_ADDOUT
Definition: SctpAssociation.h:155
void(SctpAssociation::* ccUpdateAfterSack)()
Definition: SctpAssociation.h:881
@ SITE
Definition: Ipv6Address.h:47
@ SCTP_I_SENDQUEUE_ABATED
Definition: SctpCommand_m.h:211
void stateEntered(int32_t state)
Definition: SctpAssociationBase.cc:1418
@ PATH_MANUAL
Definition: SctpAssociation.h:199
int32_t streamSchedulerFairBandwidthPacket(SctpPathVariables *path, bool peek)
Definition: SctpSsFunctions.cc:325
double getHbInterval()
Definition: Sctp.h:268
static bool ssnGt(const uint16_t ssn1, const uint16_t ssn2)
Definition: SctpAssociation.h:1080
void sendIndicationToApp(int32_t code, int32_t value=0)
Utility: sends status indication (SCTP_I_xxx) to application.
Definition: SctpAssociationUtil.cc:435
virtual void setStateCookie(SctpCookie *stateCookie)
@ ADD_OUTGOING_STREAMS_REQUEST_PARAMETER
Definition: SctpAssociation.h:151
cOutVector * sendQueue
Definition: SctpAssociation.h:947
L3Address remoteAddr
Definition: SctpAssociation.h:902
@ SCTP_E_QUEUE_BYTES_LIMIT
Definition: SctpAssociation.h:87
uint32_t lastStreamScheduled
Definition: SctpAssociation.h:616
@ NR_SACK
Definition: SctpAssociation.h:116
uint32_t bytesToRetransmit
Definition: SctpAssociation.h:622
std::list< SctpPathVariables * > lastDataSourceList
Definition: SctpAssociation.h:595
double min(const double a, const double b)
Returns the minimum of a and b.
Definition: SctpAssociation.h:261
@ GLOBAL
Definition: Ipv4Address.h:86
int32_t listeningAssocId
Definition: SctpAssociation.h:899
cOutVector * assocThroughputVector
Definition: SctpAssociation.h:920
@ DELETE_IP_ADDRESS
Definition: SctpAssociation.h:163
uint32_t localVTag
Definition: SctpAssociation.h:906
uint8_t sharedKey[512]
Definition: SctpAssociation.h:818
void process_STREAM_RESET(SctpCommandReq *sctpCommand)
Definition: SctpAssociationEventProc.cc:331
@ CCCV_CMTRPv2
Definition: SctpAssociation.h:750
SctpPathMap sctpPathMap
Definition: SctpAssociation.h:955
@ CHUNKS
Definition: SctpAssociation.h:175
@ RANDOM_SCHEDULE
Definition: SctpAssociation.h:193
bool nextChunkFitsIntoPacket(SctpPathVariables *path, int32_t bytes)
Definition: SctpAssociationUtil.cc:2624
int32_t streamSchedulerPriority(SctpPathVariables *path, bool peek)
Definition: SctpSsFunctions.cc:270
@ BENCHMARK
Definition: Ipv4Address.h:82
SctpStreamResetChunk * resetChunk
Definition: SctpAssociation.h:788
cOutVector * numGapBlocks
Definition: SctpAssociation.h:948
Sctp * sctpMain
Definition: SctpAssociation.h:953
removed InterfaceReq
Definition: IUdp-gates.txt:11
void process_RECEIVE_REQUEST(SctpEventCode &event, SctpCommandReq *sctpCommand)
Definition: SctpAssociationEventProc.cc:314
uint16_t ccModule
Definition: SctpAssociation.h:943
@ AUTH
Definition: SctpAssociation.h:115
bool receiveStreamPresent(uint32_t sid)
Definition: SctpAssociationStreamReset.cc:934
std::list< uint16_t > resetInStreams
Definition: SctpAssociation.h:791
virtual void sackSent()=0
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down DispatchProtocolReq
Definition: IUdp-gates.txt:25
@ CBSV_ReceiverOnly
Definition: SctpAssociation.h:708
cOutVector * statisticsTotalCwnd
Definition: SctpAssociation.h:968
@ HEARTBEAT_ACK
Definition: SctpAssociation.h:107
static const L3Address zeroAddress
Definition: SctpAssociation.h:519
void sendHeartbeatAck(const SctpHeartbeatChunk *heartbeatChunk, const L3Address &src, const L3Address &dest)
Definition: SctpAssociationUtil.cc:1049
int32_t(SctpAssociation::* ssGetNextSid)(SctpPathVariables *path, bool peek)
Definition: SctpAssociation.h:1292
SctpGapList gapList
Definition: SctpAssociation.h:609
@ SCTP_C_SEND
Definition: SctpCommand_m.h:132
std::list< uint16_t > streamsPending
Definition: SctpAssociation.h:792
std::map< uint16_t, int32_t > ssFairBandwidthMap
Definition: SctpAssociation.h:846
@ COOKIE_ACK
Definition: SctpAssociation.h:113
uint32_t initTsn
Definition: SctpAssociation.h:938
@ GT_Any
Definition: SctpGapList.h:95
bool chunk
Definition: SctpAssociation.h:873
bool swsAvoidanceInvoked
Definition: SctpAssociation.h:570
void cwndUpdateBeforeSack()
Definition: SctpCcFunctions.cc:133
uint32_t peerMsgRwnd
Definition: SctpAssociation.h:830
uint32_t messageAcceptLimit
Definition: SctpAssociation.h:629
uint32_t pmtu
Definition: SctpAssociation.h:292
@ SCTP_I_CONN_LOST
Definition: SctpCommand_m.h:207
bool osbWithHeader
Definition: SctpAssociation.h:821
uint32_t responseSn
Definition: SctpAssociation.h:633
std::map< uint16_t, cOutVector * > streamThroughputVectors
Definition: SctpAssociation.h:919
bool appLimited
Definition: SctpAssociation.h:780
cOutVector * statisticsNumRevokableGapBlocksSent
Definition: SctpAssociation.h:980
bool auth
Definition: SctpAssociation.h:811
uint32_t getBytesInFlightOfStream(uint16_t sid)
Definition: SctpAssociationUtil.cc:76
bool sackAlreadySent
Definition: SctpAssociation.h:577
@ SCTP_C_SHUTDOWN
Definition: SctpCommand_m.h:142
@ SCTP_I_SEND_STREAMS_RESETTED
Definition: SctpCommand_m.h:213
int getMtu() const
Definition: NetworkInterface.h:236
void addInStreams(uint32_t inStreams)
Definition: SctpSsFunctions.cc:79
@ GLOV_Optimized2
Definition: SctpAssociation.h:671
@ MBV_UseItOrLoseIt
Definition: SctpAssociation.h:683
void setAssociation(SctpAssociation *_assoc)
Definition: SctpAlgorithm.h:41
bool processPacketDropArrived(SctpPacketDropChunk *pktdrop)
Definition: SctpAssociationRcvMessage.cc:3406
@ SCTP_E_NO_MORE_OUTSTANDING
Definition: SctpAssociation.h:76
void startTimer(cMessage *timer, const simtime_t &timeout)
Definition: SctpAssociationRcvMessage.cc:3675
@ SCTP_I_CONNECTION_REFUSED
Definition: SctpCommand_m.h:202
uint16_t dataChunksAdded
Definition: SctpAssociation.h:659
bool queueUpdate
Definition: SctpAssociation.h:583
@ MISSING_NAT_ENTRY
Definition: SctpAssociation.h:183
int getMaxInitRetrans()
Definition: Sctp.h:255
bool initReceived
Definition: SctpAssociation.h:566
int getInterfaceId()
Definition: Sctp.h:273
uint32_t bytesToSend
Definition: SctpAssociation.h:875
@ SCTP_C_ACCEPT_SOCKET_ID
Definition: SctpCommand_m.h:153
bool processInitArrived(SctpInitChunk *initChunk, int32_t sport, int32_t dport)
Process incoming SCTP packets.
Definition: SctpAssociationRcvMessage.cc:532
int32_t streamScheduler(SctpPathVariables *path, bool peek)
Dealing with streams.
Definition: SctpSsFunctions.cc:115
@ CBSV_SenderOnly
Definition: SctpAssociation.h:707
bool resetPending
Definition: SctpAssociation.h:579
@ SCTP_E_RCV_SHUTDOWN_ACK
Definition: SctpAssociation.h:74
IInterfaceTable * ift
Definition: SctpAssociation.h:928
int getNagle()
Definition: Sctp.h:264
@ ADD_OUTGOING
Definition: SctpAssociation.h:146
@ ASCONF
Definition: SctpAssociation.h:121
#define SCTP_TIMEOUT_INIT_REXMIT
Definition: SctpAssociation.h:237
bool lastMsgWasFragment
Definition: SctpAssociation.h:654
void sendOnAllPaths(SctpPathVariables *firstPath)
Definition: SctpAssociationSendAll.cc:269
void addOutStreams(uint32_t outStreams)
Definition: SctpSsFunctions.cc:94
bool process_RCV_Message(SctpHeader *sctpmsg, const L3Address &src, const L3Address &dest)
Definition: SctpAssociationRcvMessage.cc:67
uint32_t sackFrequency
Definition: SctpAssociation.h:940
SctpAuthenticationChunk * createAuthChunk()
Definition: SctpAssociationAddIp.cc:210
#define SCTP_TIMEOUT_INIT_REXMIT_MAX
Definition: SctpAssociation.h:238
uint64_t queuedSentBytes
Definition: SctpAssociation.h:613
bool updateGapList(const uint32_t receivedTsn, bool &newChunkReceived, bool tsnIsRevokable=true)
Definition: SctpGapList.cc:356
@ SCTP_C_RESET_ASSOC
Definition: SctpCommand_m.h:145
@ UNSUPPORTED_HMAC
Definition: SctpAssociation.h:182
uint32_t initialPeerMsgRwnd
Definition: SctpAssociation.h:828
@ CCCV_CMTRPv1
Definition: SctpAssociation.h:749
AddressVector localAddressList
Definition: SctpAssociation.h:930
SctpSendStreamMap sendStreams
Definition: SctpAssociation.h:959
AssocStatMap assocStatMap
Definition: Sctp.h:160
@ LOOPBACK
Definition: Ipv4Address.h:76
uint32_t getNumGaps(const GapType type) const
Definition: SctpGapList.h:100
@ SCTP_E_TIMEOUT_INIT_TIMER
Definition: SctpAssociation.h:77
cOutVector * statisticsNumRevokableGapBlocksStored
Definition: SctpAssociation.h:977
const T * findProtocolData() const
Returns the protocol data for the provided type or returns nullptr if no such protocol data is found.
Definition: NetworkInterface.h:299
void updateFastRecoveryStatus(uint32_t lastTsnAck)
Definition: SctpCcFunctions.cc:578
@ ABORT
Definition: SctpAssociation.h:108
void pmDataIsSentOn(SctpPathVariables *path)
Definition: SctpAssociationUtil.cc:2728
uint16_t numAddedOutStreams
Definition: SctpAssociation.h:661
@ IPv4
Definition: L3Address.h:35
bool rpScaleBlockingTimeout
Definition: SctpAssociation.h:758
bool isToBeAccepted() const
Definition: SctpAssociation.h:1205
#define SCTP_INIT_CHUNK_LENGTH
Definition: SctpAssociation.h:204
void sendCookieAck(const L3Address &dest)
Definition: SctpAssociationUtil.cc:1083
void process_OPEN_PASSIVE(SctpEventCode &event, SctpCommandReq *sctpCommand, cMessage *msg)
Definition: SctpAssociationEventProc.cc:83
void recalculateOLIABasis()
Definition: SctpCcFunctions.cc:192
bool asconfOutstanding
Definition: SctpAssociation.h:770
bool ssLastDataChunkSizeSet
Definition: SctpAssociation.h:843
static bool tsnGe(const uint32_t tsn1, const uint32_t tsn2)
Definition: SctpAssociation.h:1075
static bool pathMapSmallestLastTransmission(const SctpPathVariables *left, const SctpPathVariables *right)
Definition: SctpAssociationSendAll.cc:148
uint32_t outgoingSackSeqNum
Definition: SctpAssociation.h:763
void pushUlp()
Definition: SctpAssociationUtil.cc:1952
#define SCTP_UDP_PORT
Definition: Sctp.h:31
cOutVector * advRwnd
Definition: SctpAssociation.h:945
void cwndUpdateBytesAcked(SctpPathVariables *path, uint32_t ackedBytes, bool ctsnaAdvanced)
Definition: SctpCcFunctions.cc:605
cObject * createOne(const char *className, const char *defaultNamespace)
Like cObjectFactory::createOne(), except it starts searching for the class in the given namespace.
Definition: INETUtils.cc:147
uint32_t gapListOptimizationVariant
Definition: SctpAssociation.h:674
uint8_t peerKeyVector[512]
Definition: SctpAssociation.h:816
bool primaryPathCandidate
Definition: SctpAssociation.h:281
uint32_t getSizeOfFirstChunk(const L3Address &remoteAddress)
Definition: SctpQueue.cc:224
virtual void initialize()
Definition: SctpAlgorithm.h:48
uint16_t sendResponse
Definition: SctpAssociation.h:632
@ INVALID_STREAM_IDENTIFIER
Definition: SctpAssociation.h:180
bool isUnspecified() const
Definition: L3Address.cc:138
@ MBV_AggressiveMaxBurst
Definition: SctpAssociation.h:688
bool peerAuth
Definition: SctpAssociation.h:810
void moveChunkToOtherPath(SctpDataVariables *chunk, SctpPathVariables *newPath)
Definition: SctpAssociationRcvMessage.cc:3895
void initAssociation(SctpOpenReq *openCmd)
Utility: creates send/receive queues and sctpAlgorithm.
Definition: SctpAssociationUtil.cc:508
L3Address initialPrimaryPath
Definition: SctpAssociation.h:594
bool tsnInGapList(const uint32_t tsn) const
Definition: SctpGapList.h:113
cOutVector * statisticsTotalSSthresh
Definition: SctpAssociation.h:967
#define SCTP_ADD_IP_CHUNK_LENGTH
Definition: SctpAssociation.h:222
uint32_t expectedStreamResetSequenceNumber
Definition: SctpAssociation.h:783
@ SCTP_C_RECEIVE
Definition: SctpCommand_m.h:136
bool cmtUseDAC
Definition: SctpAssociation.h:729
bool cmtSmartReneging
Definition: SctpAssociation.h:726
SctpAsconfChunk * asconfChunk
Definition: SctpAssociation.h:771
uint32_t outboundStreams
Definition: SctpAssociation.h:934
std::map< uint16_t, uint32_t > ssPriorityMap
Definition: SctpAssociation.h:845
@ SCTP_I_DATA
Definition: SctpCommand_m.h:197
int32_t updateCounters(SctpPathVariables *path)
Definition: SctpAssociationRcvMessage.cc:3704
bool stopSending
Definition: SctpAssociation.h:587
bool cmtSmartFastRTX
Definition: SctpAssociation.h:725
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down PacketProtocolTag
Definition: IUdp-gates.txt:25
void(SctpAssociation::* ssAddInStreams)(uint32_t inStreams)
Definition: SctpAssociation.h:1290
bool highSpeedCC
Definition: SctpAssociation.h:743
bool processCookieAckArrived()
Definition: SctpAssociationRcvMessage.cc:890
bool padding
Definition: SctpAssociation.h:822
std::list< uint16_t > resetOutStreams
Definition: SctpAssociation.h:790
void setInitialCumAckTsn(const uint32_t cumAckTsn)
Definition: SctpGapList.h:73
#define SCTP_SSN_TSN_RESET_REQUEST_PARAMETER_LENGTH
Definition: SctpAssociation.h:218
SctpDataVariables * getChunkFast(const uint32_t tsn, bool &firstTime)
Definition: SctpQueue.cc:121
@ SCTP_C_ABORT
Definition: SctpCommand_m.h:134
@ ERROR_DELETE_LAST_IP_ADDRESS
Definition: SctpAssociation.h:166
@ SHUTDOWN
Definition: SctpAssociation.h:109
@ SCTP_E_RCV_ABORT
Definition: SctpAssociation.h:69
@ SCTP_E_CLOSE
Definition: SctpAssociation.h:66
@ NOTHING_TO_DO
Definition: SctpAssociation.h:134
friend class SctpPathVariables
Definition: SctpAssociation.h:856
@ PERFORMED_WITH_OPTION
Definition: SctpAssociation.h:154
void fragmentOutboundDataMsgs()
Definition: SctpAssociationUtil.cc:2428
@ SSN_TSN_RESET_REQUEST_PARAMETER
Definition: SctpAssociation.h:149
cOutVector * vectorPathReceivedTsn
Definition: SctpAssociation.h:394
bool listening
Definition: SctpAssociation.h:901
const L3Address & getPrimaryPathIndex() const
Definition: SctpAssociation.h:541
uint32_t numGapReports
Definition: SctpAssociation.h:593
simtime_t lastTransmission
Definition: SctpAssociation.h:611
cOutVector * statisticsPeerRwnd
Definition: SctpAssociation.h:974
@ SUCCESS_INDICATION
Definition: SctpAssociation.h:165
virtual SctpShutdownChunk * dup() const override
Definition: SctpHeader_m.h:1323
void addLocalAddressToAllRemoteAddresses(SctpAssociation *assoc, L3Address address, std::vector< L3Address > remAddresses)
Definition: Sctp.cc:704
virtual void sendCommandInvoked(SctpPathVariables *path)=0
@ REQUEST_IN_PROGRESS
Definition: SctpAssociation.h:138
SctpDataVariables * peekAbandonedChunk(const SctpPathVariables *path)
Definition: SctpAssociationUtil.cc:2380
uint32_t assocThroughput
Definition: SctpAssociation.h:840
uint32_t messagesToPush
Definition: SctpAssociation.h:623
void process_TIMEOUT_ASCONF(SctpPathVariables *path)
Definition: SctpAssociationRcvMessage.cc:3742
void setRtoMax(double rtoMax)
Definition: Sctp.h:271
@ SCTP_S_SHUTDOWN_SENT
Definition: SctpAssociation.h:52
bool peerAllowsChunks
Definition: SctpAssociation.h:827
@ MULTICAST
Definition: Ipv6Address.h:45
@ SCTP_I_ESTABLISHED
Definition: SctpCommand_m.h:199
void handleChunkReportedAsAcked(uint32_t &highestNewAck, simtime_t &rttEstimation, SctpDataVariables *myChunk, SctpPathVariables *sackPath, const bool sackIsNonRevokable)
Definition: SctpAssociationRcvMessage.cc:1586
uint32_t numberOfRemoteAddresses
Definition: SctpAssociation.h:932
bool allowCMT
Definition: SctpAssociation.h:694
void setRtoInitial(double rtoInitial)
Definition: Sctp.h:269
void putInDeliveryQ(uint16_t sid)
Definition: SctpAssociationUtil.cc:1912
cMessage * T5_ShutdownGuardTimer
Definition: SctpAssociation.h:912
@ ASCONF_ACK
Definition: SctpAssociation.h:117
bool findPeerRequestNum(uint32_t num)
Definition: SctpAssociationBase.cc:505
@ SCTP_E_RCV_VALID_COOKIE_ECHO
Definition: SctpAssociation.h:70
@ CCCV_CMTRP_Test1
Definition: SctpAssociation.h:753
double cmtChunkReschedulingThreshold
Definition: SctpAssociation.h:722
SctpEventCode processOutAndResponseArrived(SctpOutgoingSsnResetRequestParameter *outRequestParam, SctpStreamResetResponseParameter *responseParam)
Definition: SctpAssociationRcvMessage.cc:2757
int32_t(SctpAssociation::* ssUsableStreams)()
Definition: SctpAssociation.h:1293
@ CCRV_None
Definition: SctpAssociation.h:715
void sendShutdownAck(const L3Address &dest)
Definition: SctpAssociationUtil.cc:1107
value< double, units::s > s
Definition: Units.h:1235
std::list< uint16_t > streamsToReset
Definition: SctpAssociation.h:793
@ SCTP_E_ACCEPT_SOCKET_ID
Definition: SctpAssociation.h:98
#define SCTP_COMMON_HEADER
Definition: SctpAssociation.h:203
void loadPacket(SctpPathVariables *pathVar, Ptr< SctpHeader > *sctpMsg, uint16_t *chunksAdded, uint16_t *dataChunksAdded, bool *authAdded)
Definition: SctpAssociationSendAll.cc:83
intscale< b, 1, 8 > B
Definition: Units.h:1168
SctpPathVariables * choosePathForRetransmission()
Definition: SctpAssociationSendAll.cc:231
@ BROADCAST
Definition: Ipv4Address.h:78
bool checkAndInsertChunk(const uint32_t key, SctpDataVariables *chunk)
Definition: SctpQueue.cc:39
cOutVector * cumTsnAck
Definition: SctpAssociation.h:946
bool fairTimer
Definition: SctpAssociation.h:918
virtual NetworkInterface * getOutputInterfaceForDestination(const L3Address &dest) const =0
Convenience function based on findBestMatchingRoute().
bool cmtSlowPathRTTUpdate
Definition: SctpAssociation.h:727
CrcMode crcMode
Definition: Sctp.h:206
SctpQueue * retransmissionQ
Definition: SctpAssociation.h:958
#define SCTP_OUTGOING_RESET_REQUEST_PARAMETER_LENGTH
Definition: SctpAssociation.h:216
bool activePath
Definition: SctpAssociation.h:278
@ SCTP_C_SEND_ORDERED
Definition: SctpCommand_m.h:137
@ PATH_MAP_TO_PATH
Definition: SctpAssociation.h:200
void retransmitAsconf()
Definition: SctpAssociationAddIp.cc:158
uint32_t sizeKeyVector
Definition: SctpAssociation.h:815
uint32_t streamResetSequenceNumber
Definition: SctpAssociation.h:782
bool typeInOwnChunkList(uint16_t type)
Definition: SctpAssociationAddIp.cc:287
@ SCTP_I_CONNECTION_RESET
Definition: SctpCommand_m.h:203
#define ADD_PADDING(x)
Definition: SctpAssociation.h:252
@ PRIORITY
Definition: SctpAssociation.h:197
@ SCTP_E_RCV_INIT_ACK
Definition: SctpAssociation.h:71
@ STREAM_RESET_RESPONSE_PARAMETER
Definition: SctpAssociation.h:150
SctpEventCode processAsconfArrived(SctpAsconfChunk *asconfChunk)
Definition: SctpAssociationRcvMessage.cc:3170
SctpAlgorithm * sctpAlgorithm
Definition: SctpAssociation.h:961
static const Protocol udp
Definition: Protocol.h:117
@ SHUTDOWN_ACK
Definition: SctpAssociation.h:110
const L3Address & getNextAddress(const SctpPathVariables *oldPath) const
Definition: SctpAssociation.h:1220
cFSM * fsm
Definition: SctpAssociation.h:954
CounterMap bookedTransQ
Definition: SctpAssociation.h:868
uint16_t remotePort
Definition: SctpAssociation.h:905
@ SCTP_C_QUEUE_BYTES_LIMIT
Definition: SctpCommand_m.h:140
void process_ASSOCIATE(SctpEventCode &event, SctpCommandReq *sctpCommand, cMessage *msg)
Definition: SctpAssociationEventProc.cc:27
@ PR_TTL
Definition: SctpAssociation.h:127
uint32_t lastTsnReceived
Definition: SctpAssociation.h:606
std::list< uint32_t > dupList
Definition: SctpAssociation.h:598
bool strictCwndBooking
Definition: SctpAssociation.h:734
@ INIT
Definition: SctpAssociation.h:103
if(cwndVector) cwndVector -> record(state->snd_cwnd)
@ SCTP_I_SHUTDOWN_RECEIVED
Definition: SctpCommand_m.h:209
void initCcParameters(SctpPathVariables *path)
SctpCcFunctions.
Definition: SctpCcFunctions.cc:397
uint32_t initInboundStreams
Definition: SctpAssociation.h:935
@ SCTP_C_NO_OUTSTANDING
Definition: SctpCommand_m.h:143
simtime_t initRexmitTimeout
Definition: SctpAssociation.h:640
uint32_t bufferedMessages
Definition: SctpAssociation.h:831
cMessage * T2_ShutdownTimer
Definition: SctpAssociation.h:911
std::vector< SctpPathVariables * > getSortedPathMap()
Definition: SctpAssociationSendAll.cc:121
SctpPathCollection assocBestPaths
Definition: SctpAssociation.h:891
void sendToApp(cMessage *msg)
Utility: sends packet to application.
Definition: SctpAssociationUtil.cc:501
@ PR_PRIO
Definition: SctpAssociation.h:129
BytesToBeSent bytes
Definition: SctpAssociation.h:952
@ SCTP_I_PEER_CLOSED
Definition: SctpCommand_m.h:200
bool compareRandom()
Definition: SctpAssociationAddIp.cc:226
@ SCTP_C_ASSOCIATE
Definition: SctpCommand_m.h:130
static uint16_t chunkToInt(const char *type)
Definition: SctpAssociationUtil.cc:237
uint32_t localMsgRwnd
Definition: SctpAssociation.h:829
void sendPacketDrop(const bool flag)
Definition: SctpAssociationUtil.cc:1243
BufferSplitVariant cmtBufferSplitVariant
Definition: SctpAssociation.h:711
void insertTransportProtocolHeader(Packet *packet, const Protocol &protocol, const Ptr< TransportHeaderBase > &header)
Definition: L4Tools.cc:77
cMessage * FairStopTimer
Definition: SctpAssociation.h:922
int32_t streamSchedulerFCFS(SctpPathVariables *path, bool peek)
Definition: SctpSsFunctions.cc:428
bool unorderedQueueEmptyOfStream(uint16_t sid)
Definition: SctpAssociationUtil.cc:90
SctpCookieEchoChunk * cookieChunk
pointer to the cookie chunk data structure (for retransmissions)
Definition: SctpAssociation.h:644
bool stopReading
Definition: SctpAssociation.h:588
@ DEFERRED
Definition: SctpAssociation.h:140
void chunkReschedulingControl(SctpPathVariables *path)
Definition: SctpAssociationSendAll.cc:330
void setRtoMin(double rtoMin)
Definition: Sctp.h:270
L3Address localAddr
Definition: SctpAssociation.h:903
#define SCTP_COOKIE_LENGTH
Definition: SctpAssociation.h:232
uint16_t ssModule
Definition: SctpAssociation.h:1296
@ CCCV_CMT_OLIA
Definition: SctpAssociation.h:752
void(SctpAssociation::* ccUpdateMaxBurst)(SctpPathVariables *path)
Definition: SctpAssociation.h:884
uint16_t peerRequestType
Definition: SctpAssociation.h:798
@ ERROR_DELETE_SOURCE_ADDRESS
Definition: SctpAssociation.h:167
@ CBSV_None
Definition: SctpAssociation.h:706
void processResetResponseArrived(SctpStreamResetResponseParameter *responseParam)
Definition: SctpAssociationRcvMessage.cc:2518
SctpResetReq * resetInfo
Definition: SctpAssociation.h:797
void stopTimers()
Definition: SctpAssociationRcvMessage.cc:3659
uint32_t numFastRtx
Definition: Sctp.h:130
void sendStreamResetRequest(SctpResetReq *info)
Definition: SctpAssociationStreamReset.cc:512
removed type
Definition: IUdp-gates.txt:7
void(SctpAssociation::* ccUpdateBytesAcked)(SctpPathVariables *path, const uint32_t ackedBytes, const bool ctsnaAdvanced)
Definition: SctpAssociation.h:885
bool chunkHasBeenAcked(const SctpDataVariables *chunk) const
Definition: SctpAssociation.h:1450
void process_SEND(SctpEventCode &event, SctpCommandReq *sctpCommand, cMessage *msg)
Definition: SctpAssociationEventProc.cc:126
uint32_t lastTsnAck
Definition: SctpAssociation.h:604
void handleChunkReportedAsMissing(const SctpSackChunk *sackChunk, const uint32_t highestNewAck, SctpDataVariables *myChunk, SctpPathVariables *sackPath)
Definition: SctpAssociationRcvMessage.cc:1688
void removeRemoteAddressFromAllAssociations(SctpAssociation *assoc, L3Address address, std::vector< L3Address > locAddresses)
Definition: Sctp.cc:758
CUCVariant cmtCUCVariant
Definition: SctpAssociation.h:703
void removeFromGapList(const uint32_t removedTsn)
Definition: SctpGapList.cc:348
@ SCTP_C_QUEUE_MSGS_LIMIT
Definition: SctpCommand_m.h:141
uint32_t swsLimit
Definition: SctpAssociation.h:653
void sendInitAck(SctpInitChunk *initchunk)
Definition: SctpAssociationUtil.cc:772
uint32_t fragPoint
Definition: SctpAssociation.h:618
uint16_t getNumRequestsNotPerformed()
Definition: SctpAssociationBase.cc:540
bool makeRoomForTsn(const uint32_t tsn, const uint32_t length, const bool uBit)
Definition: SctpAssociationUtil.cc:2154
SctpDataVariables * makeVarFromMsg(SctpDataChunk *datachunk)
Definition: SctpAssociationUtil.cc:2245
bool cmtSmartT3Reset
Definition: SctpAssociation.h:724
@ RESERVED
Definition: Ipv4Address.h:83
double increaseFactor
Definition: SctpCcFunctions.cc:33
bool typeInChunkList(uint16_t type)
Definition: SctpAssociationAddIp.cc:277
uint32_t rpMinCwnd
Definition: SctpAssociation.h:759
simtime_t lastThroughputTime
Definition: SctpAssociation.h:837
SctpForwardTsnChunk * createForwardTsnChunk(const L3Address &pid)
Definition: SctpAssociationUtil.cc:1349
uint8_t peerTieTag[32]
Definition: SctpAssociation.h:627
int getMaxInitRetransTimeout()
Definition: Sctp.h:256
cOutVector * statisticsTotalBandwidth
Definition: SctpAssociation.h:969
@ SCTP_S_COOKIE_ECHOED
Definition: SctpAssociation.h:49
int32_t status
Definition: SctpAssociation.h:937
bool packet
Definition: SctpAssociation.h:874
void resetExpectedSsns()
Definition: SctpAssociationStreamReset.cc:884
@ SCTP_E_RESET_ASSOC
Definition: SctpAssociation.h:92
void calculateRcvBuffer()
Definition: SctpAssociationUtil.cc:47
void increaseOutstandingBytes(SctpDataVariables *chunk, SctpPathVariables *path)
Definition: SctpAssociationSendAll.cc:20
int32_t rpPathBlockingControl(SctpPathVariables *path, double reduction)
Definition: SctpCcFunctions.cc:410
bool rpPathBlocking
Definition: SctpAssociation.h:757
void sendInit()
Methods for creating and sending chunks.
Definition: SctpAssociationUtil.cc:554
cOutVector * statisticsNumDuplicatesStored
Definition: SctpAssociation.h:979
uint32_t initialWindow
Definition: SctpAssociation.h:692
@ SCTP_C_SET_RTO_INFO
Definition: SctpCommand_m.h:152
void processSsnTsnResetRequestArrived(SctpSsnTsnResetRequestParameter *requestParam)
Definition: SctpAssociationRcvMessage.cc:2482
@ CUCV_PseudoCumAck
Definition: SctpAssociation.h:700
bool sackAllowed
Definition: SctpAssociation.h:576
void resetGaps(const uint32_t newCumAck)
Definition: SctpGapList.cc:384
@ GT_Revokable
Definition: SctpGapList.h:96
IRoutingTable * rt
Definition: SctpAssociation.h:927
@ CCCV_Off
Definition: SctpAssociation.h:747
double sackPeriod
Definition: SctpAssociation.h:941
@ OUTGOING_RESET_REQUEST_PARAMETER
Definition: SctpAssociation.h:147
SctpEventCode processSackArrived(SctpSackChunk *sackChunk)
Definition: SctpAssociationRcvMessage.cc:974
cOutVector * statisticsNumNonRevokableGapBlocksSent
Definition: SctpAssociation.h:981
bool findPeerStreamToReset(uint16_t sn)
Definition: SctpAssociationBase.cc:510
@ SCTP_E_ABORT
Definition: SctpAssociation.h:64
value< int64_t, units::b > b
Definition: Units.h:1241
uint32_t lastTsnBeforeReset
Definition: SctpAssociation.h:787
bool getEnableHeartbeats()
Definition: Sctp.h:265
void removeAssociation(SctpAssociation *assoc)
Definition: Sctp.cc:846
uint32_t getAllTransQ()
Definition: SctpAssociationSendAll.cc:1476
void process_PRIMARY(SctpEventCode &event, SctpCommandReq *sctpCommand)
Definition: SctpAssociationEventProc.cc:325
#define SCTP_SHUTDOWN_CHUNK_LENGTH
Definition: SctpAssociation.h:212
void sendToIP(Packet *pkt, const Ptr< SctpHeader > &sctpmsg, L3Address dest)
Utility: adds control info to message and sends it to IP.
Definition: SctpAssociationUtil.cc:360
bool tsnIsDuplicate(const uint32_t tsn) const
Methods dealing with the handling of TSNs
Definition: SctpAssociationUtil.cc:2234
void sendShutdownComplete()
Definition: SctpAssociationUtil.cc:1135
int32_t pushMessagesLeft
Definition: SctpAssociation.h:624
@ MBV_MaxBurst
Definition: SctpAssociation.h:687
uint16_t chunksAdded
Definition: SctpAssociation.h:658
@ MULTICAST
Definition: Ipv4Address.h:77
static bool SCTP_UINT16_GT(uint16_t a, uint16_t b)
Compare TSNs.
Definition: SctpAssociation.h:1059
#define SCTP_HEARTBEAT_CHUNK_LENGTH
Definition: SctpAssociation.h:208
bool stopOldData
Definition: SctpAssociation.h:582
SctpVTagMap sctpVTagMap
Definition: Sctp.h:162
@ SCTP_I_DATA_NOTIFICATION
Definition: SctpCommand_m.h:198
@ PR_RTX
Definition: SctpAssociation.h:128
virtual const SctpCookie * getStateCookie() const
#define SCTP_DATA_CHUNK_LENGTH
Definition: SctpAssociation.h:205
#define SCTP_ABORT_CHUNK_LENGTH
Definition: SctpAssociation.h:209
@ HMAC_ALGO
Definition: SctpAssociation.h:176
@ NO_RESET
Definition: SctpAssociation.h:139
@ SCTP_I_STATUS
Definition: SctpCommand_m.h:205
bool performStateTransition(const SctpEventCode &event)
Implemements the pure SCTP state machine.
Definition: SctpAssociationBase.cc:1176
@ ADD_INCOMING_STREAMS_REQUEST_PARAMETER
Definition: SctpAssociation.h:152
void sendCookieEcho(SctpInitAckChunk *initackchunk)
Definition: SctpAssociationUtil.cc:952
#define SCTP_ADD_STREAMS_REQUEST_PARAMETER_LENGTH
Definition: SctpAssociation.h:220
@ LINKLOCAL
Definition: Ipv4Address.h:84
SctpPathVariables * getPath(const L3Address &pathId) const
Definition: SctpAssociation.h:1047
bool requestsOverlap
Definition: SctpAssociation.h:781
uint32_t corrIdNum
Definition: SctpAssociation.h:769
bool sendHeartbeatsOnActivePaths
Definition: SctpAssociation.h:656
void retransmitShutdown()
Definition: SctpAssociationUtil.cc:1215
SctpEventCode processInAndOutResetRequestArrived(SctpIncomingSsnResetRequestParameter *inRequestParam, SctpOutgoingSsnResetRequestParameter *outRequestParam)
Definition: SctpAssociationRcvMessage.cc:2634
double max(const double a, const double b)
Returns the maximum of a and b.
Definition: SctpAssociation.h:266
@ SCTP_S_SHUTDOWN_ACK_SENT
Definition: SctpAssociation.h:54
@ SCTP_S_COOKIE_WAIT
Definition: SctpAssociation.h:48
#define IP_HEADER_LENGTH
Definition: SctpAssociation.h:227
@ SCTP_E_TIMEOUT_RTX_TIMER
Definition: SctpAssociation.h:79
const double k
Definition: Qam1024Modulation.cc:14
#define SCTP_STREAM_RESET_RESPONSE_PARAMETER_LENGTH
Definition: SctpAssociation.h:219
bool checkSackSeqNumber
Definition: SctpAssociation.h:762
@ SCTP_I_TIMED_OUT
Definition: SctpCommand_m.h:204
uint64_t bytesRcvd
Definition: SctpAssociation.h:620
@ ERRORTYPE
Definition: SctpAssociation.h:111
@ SCTP_E_PRIMARY
Definition: SctpAssociation.h:84
void sendShutdown()
Definition: SctpAssociationUtil.cc:1181
void pmRttMeasurement(SctpPathVariables *path, const simtime_t &rttEstimation)
Definition: SctpAssociationUtil.cc:2836
bool newChunkReceived
Definition: SctpAssociation.h:568
static const char * stateName(int32_t state)
Utility: returns name of SCTP_S_xxx constants.
Definition: SctpAssociationUtil.cc:139
AddressVector remoteAddressList
Definition: SctpAssociation.h:931
SctpAssociation(Sctp *mod, int32_t appGateIndex, int32_t assocId, IRoutingTable *rt, IInterfaceTable *ift)
Constructor.
Definition: SctpAssociationBase.cc:555
uint64_t queuedReceivedBytes
Definition: SctpAssociation.h:615
@ GT_NonRevokable
Definition: SctpGapList.h:97
void storePacket(SctpPathVariables *pathVar, const Ptr< SctpHeader > &sctpMsg, uint16_t chunksAdded, uint16_t dataChunksAdded, bool authAdded)
Definition: SctpAssociationSendAll.cc:45
@ DATA
Definition: SctpAssociation.h:102
#define PK(msg)
Definition: INETDefs.h:89
uint64_t sendBuffer
Definition: SctpAssociation.h:649
bool auth
Definition: Sctp.h:200
void nonRenegablyAckChunk(SctpDataVariables *chunk, SctpPathVariables *sackPath, simtime_t &rttEstimation, Sctp::AssocStat *assocStat)
Definition: SctpAssociationRcvMessage.cc:1851
virtual SctpStateVariables * createStateVariables()=0
void process_TIMEOUT_HEARTBEAT_INTERVAL(SctpPathVariables *path, bool force)
Definition: SctpAssociationRcvMessage.cc:3595
cOutVector * statisticsRevokableGapBlocksInLastSACK
Definition: SctpAssociation.h:971
void resetSsns()
Methods for Stream Reset.
Definition: SctpAssociationStreamReset.cc:914
bool cmtUseSFR
Definition: SctpAssociation.h:728
SctpSackChunk * createSack()
Definition: SctpAssociationUtil.cc:1537
@ INCOMING_RESET_REQUEST_PARAMETER
Definition: SctpAssociation.h:148
@ SCTP_C_SET_STREAM_PRIO
Definition: SctpCommand_m.h:149
SSFunctions ssFunctions
Definition: SctpAssociation.h:1295
std::map< uint16_t, int32_t > ssStreamToPathMap
Definition: SctpAssociation.h:847
uint32_t packetsInTotalBurst
Definition: SctpAssociation.h:610
#define SCTP_AUTH_CHUNK_LENGTH
Definition: SctpAssociation.h:224
@ SCTP_S_CLOSED
Definition: SctpAssociation.h:47
uint64_t roomSumSendStreams
Definition: SctpAssociation.h:864
const char * cmtRetransmissionVariant
Definition: SctpAssociation.h:696
@ CCRV_SenderOnly
Definition: SctpAssociation.h:716
@ CSP_Standard
Definition: SctpAssociation.h:736
void addForkedAssociation(SctpAssociation *assoc, SctpAssociation *newAssoc, L3Address localAddr, L3Address remoteAddr, int32_t localPort, int32_t remotePort)
Update assocs socket pair, and register newAssoc (which'll keep LISTENing).
Definition: Sctp.cc:805
MBVariant maxBurstVariant
Definition: SctpAssociation.h:691
cMessage * StartAddIP
Definition: SctpAssociation.h:915
@ SCTP_E_TIMEOUT_SHUTDOWN_TIMER
Definition: SctpAssociation.h:78
RequestData * findTypeInRequests(uint16_t type)
Definition: SctpAssociationBase.cc:530
uint64_t queuedDroppableBytes
Definition: SctpAssociation.h:614
#define SCTP_SUPPORTED_EXTENSIONS_PARAMETER_LENGTH
Definition: SctpAssociation.h:221
@ IPv6
Definition: L3Address.h:36
@ SCTP_E_DELIVERED
Definition: SctpAssociation.h:85
bool orderedQueueEmptyOfStream(uint16_t sid)
Definition: SctpAssociationUtil.cc:83
void sendAddOutgoingStreamsRequest(uint16_t numStreams)
Definition: SctpAssociationStreamReset.cc:645
uint32_t outstandingMessages
Definition: SctpAssociation.h:832
cOutVector * statisticsNonRevokableGapBlocksInLastSACK
Definition: SctpAssociation.h:972
Ptr< SctpHeader > sctpMsg
Definition: SctpAssociation.h:657
AssocStat * getAssocStat(uint32_t assocId)
Definition: Sctp.h:216
int32_t fd
Definition: SctpAssociation.h:900
uint8_t keyVector[512]
Definition: SctpAssociation.h:814
@ CUCV_Normal
Definition: SctpAssociation.h:699
bool stopReceiving
Definition: SctpAssociation.h:581
@ RE_CONFIG
Definition: SctpAssociation.h:119
cOutVector * EndToEndDelay
Definition: SctpAssociation.h:917
#define SCTP_COMPRESSED_NRSACK_CHUNK_LENGTH
Definition: SctpAssociation.h:235
bool streamIsPending(int32_t sid)
Definition: SctpAssociationStreamReset.cc:31
bool bundleReset
Definition: SctpAssociation.h:777
cOutVector * statisticsNumNonRevokableGapBlocksStored
Definition: SctpAssociation.h:978
void tsnWasReneged(SctpDataVariables *chunk, const SctpPathVariables *sackPath, const int type)
Definition: SctpAssociationRcvMessage.cc:909
ChunkReschedulingVariant cmtChunkReschedulingVariant
Definition: SctpAssociation.h:721
bool fragInProgress
Definition: SctpAssociation.h:591
static const char * eventName(int32_t event)
Utility: returns name of SCTP_E_xxx constants.
Definition: SctpAssociationUtil.cc:158
#define SCTP_TSN_GE(a, b)
Definition: SctpAssociation.h:1072
@ FAIR_BANDWITH_PACKET
Definition: SctpAssociation.h:196
cOutVector * advMsgRwnd
Definition: SctpAssociation.h:916
@ SCTP_I_ABORT
Definition: SctpCommand_m.h:206
static const Protocol sctp
Definition: Protocol.h:108
static int getAddressLevel(const L3Address &addr)
Utility: return IPv4 or IPv6 address level.
Definition: SctpAssociationUtil.cc:2895
void sendOnPath(SctpPathVariables *pathId, const bool firstPass=true)
Utility: Send data from sendQueue.
Definition: SctpAssociationSendAll.cc:659
uint32_t advancedPeerAckPoint
Definition: SctpAssociation.h:825
void(SctpAssociation::* ccUpdateBeforeSack)()
Definition: SctpAssociation.h:880
bool tellArwnd
Definition: SctpAssociation.h:835
@ GLOV_None
Definition: SctpAssociation.h:669
void ackChunk(SctpDataVariables *chunk, SctpPathVariables *sackPath)
Definition: SctpAssociation.h:1439
#define SCTP_DEFAULT_INBOUND_STREAMS
Definition: SctpAssociation.h:229
virtual int getNumInterfaces() const =0
Returns the number of interfaces.
uint32_t packetBytes
Definition: SctpAssociation.h:660
cPacket * userData
Definition: SctpAssociation.h:473
bool firstPeerRequest
Definition: SctpAssociation.h:779
SctpParameter * makeSsnTsnResetParameter(uint32_t srsn)
Definition: SctpAssociationStreamReset.cc:398
@ MBV_CongestionWindowLimitingTempCwnd
Definition: SctpAssociation.h:686
@ SCTP_I_SEND_MSG
Definition: SctpCommand_m.h:208
int32_t pathStreamSchedulerMapToPath(SctpPathVariables *path, bool peek)
Definition: SctpSsFunctions.cc:522
static bool pathMapLargestSpace(const SctpPathVariables *left, const SctpPathVariables *right)
Definition: SctpAssociationSendAll.cc:158
bool nrSack
Definition: SctpAssociation.h:666
SctpReceiveStreamMap receiveStreams
Definition: SctpAssociation.h:960
@ SSN_TSN
Definition: SctpAssociation.h:144
bool nagleEnabled
Definition: SctpAssociation.h:575
bool pktdrop
Definition: Sctp.h:202
bool smartOverfullSACKHandling
Definition: SctpAssociation.h:675
SctpPathCollection assocMaxWndPaths
Definition: SctpAssociation.h:892
void pathStatusIndication(const SctpPathVariables *path, bool status)
Definition: SctpAssociationUtil.cc:2821
bool cmtBufferSplittingUsesOSB
Definition: SctpAssociation.h:712
#define SHUTDOWN_GUARD_TIMEOUT
Definition: SctpAssociation.h:256
SctpAssociation * cloneAssociation()
Utility: clone a listening association.
Definition: SctpAssociationUtil.cc:304
* tags
Definition: IUdp-gates.txt:3
void removeMsg(const uint32_t key)
Definition: SctpQueue.cc:145
AddressVector localAddresses
Definition: SctpAssociation.h:597
@ COOKIE_ECHO
Definition: SctpAssociation.h:112
@ SCTP_E_SEND_ASCONF
Definition: SctpAssociation.h:94
bool sackNow
Definition: Sctp.h:203
bool cmtUseFRC
Definition: SctpAssociation.h:730
std::list< uint16_t > peerStreamsToReset
Definition: SctpAssociation.h:794
void forwardCumAckTsn(const uint32_t cumAckTsn)
Definition: SctpGapList.cc:328
void sendOutgoingResetRequest(SctpIncomingSsnResetRequestParameter *requestParam)
Definition: SctpAssociationStreamReset.cc:116
virtual SctpResetReq * dup() const override
Definition: SctpCommand_m.h:760
@ GLOV_Shrunken
Definition: SctpAssociation.h:672
static bool tsnLe(const uint32_t tsn1, const uint32_t tsn2)
Definition: SctpAssociation.h:1077
double decreaseFactor
Definition: SctpCcFunctions.cc:34
unsigned int blockingTsnsMoved
Definition: SctpAssociation.h:733
void updateSockPair(SctpAssociation *assoc, L3Address localAddr, L3Address remoteAddr, int32_t localPort, int32_t remotePort)
To be called from SctpAssociation when socket pair changes.
Definition: Sctp.cc:642
void renegablyAckChunk(SctpDataVariables *chunk, SctpPathVariables *sackPath)
Definition: SctpAssociationRcvMessage.cc:1953
void removeLocalAddressFromAllRemoteAddresses(SctpAssociation *assoc, L3Address address, std::vector< L3Address > remAddresses)
Definition: Sctp.cc:735
void process_TIMEOUT_HEARTBEAT(SctpPathVariables *path)
Definition: SctpAssociationRcvMessage.cc:3613
bool processInitAckArrived(SctpInitAckChunk *initAckChunk)
Definition: SctpAssociationRcvMessage.cc:730
@ SCTP_E_ADD_STREAMS
Definition: SctpAssociation.h:93
uint32_t msgNum
Definition: SctpAssociation.h:619
bool getFragInProgressOfStream(uint16_t sid)
Definition: SctpAssociationUtil.cc:97
int32_t streamSchedulerRandom(SctpPathVariables *path, bool peek)
Definition: SctpSsFunctions.cc:220
@ SCTP_I_ABANDONED
Definition: SctpCommand_m.h:212
uint32_t errorCount
Definition: SctpAssociation.h:599
bool active
Definition: SctpAssociation.h:562
uint8_t localTieTag[32]
Definition: SctpAssociation.h:626
#define SACK_DELAY
Definition: SctpAssociation.h:239
void process_TIMEOUT_RESET(SctpPathVariables *path)
Definition: SctpAssociationRcvMessage.cc:3682
SctpShutdownAckChunk * shutdownAckChunk
Definition: SctpAssociation.h:647
SctpPathVariables * lastDataSourcePath
Definition: SctpAssociation.h:596
Ipv4Address toIpv4() const
Definition: L3Address.h:70
SctpParameter * makeOutgoingStreamResetParameter(uint32_t srsn, SctpResetReq *info)
Definition: SctpAssociationStreamReset.cc:322
uint32_t peerTsnAfterReset
Definition: SctpAssociation.h:786
SctpPathCollection assocCollectedPaths
Definition: SctpAssociation.h:893
cMessage * T1_InitTimer
Definition: SctpAssociation.h:910
uint16_t numResetRequests
Definition: SctpAssociation.h:634
uint32_t tsn
Definition: SctpAssociation.h:479
virtual SctpCookieEchoChunk * dup() const override
Definition: SctpHeader_m.h:611
uint64_t initialPeerRwnd
Definition: SctpAssociation.h:601
void(SctpAssociation::* ssInitStreams)(uint32_t inStreams, uint32_t outStreams)
Definition: SctpAssociation.h:1289
@ RESET_OUTGOING
Definition: SctpAssociation.h:141
void pmStartPathManagement()
Flow control.
Definition: SctpAssociationUtil.cc:2749
void process_TIMEOUT_SHUTDOWN(SctpEventCode &event)
Definition: SctpAssociationRcvMessage.cc:3573
cOutVector * statisticsQueuedSentBytes
Definition: SctpAssociation.h:966
cMessage * StartTesting
Definition: SctpAssociation.h:914
SctpPathVariables * getPrimaryPath() const
Definition: SctpAssociation.h:549
#define SCTP_COOKIE_ACK_LENGTH
Definition: SctpAssociation.h:210
bool findRequestNum(uint32_t num)
Definition: SctpAssociationBase.cc:500
#define SCTP_SACK_CHUNK_LENGTH
Definition: SctpAssociation.h:206
void updateHighSpeedCCThresholdIdx(SctpPathVariables *path)
Definition: SctpCcFunctions.cc:113
std::map< uint32_t, RequestData > peerRequests
Definition: SctpAssociation.h:796
std::vector< L3Address > AddressVector
Definition: SctpAssociation.h:42
uint32_t getCumAckTsn() const
Definition: SctpGapList.h:79
#define SHA_LENGTH
Definition: SctpAssociation.h:226
@ CUCV_PseudoCumAckV2
Definition: SctpAssociation.h:701
std::list< SctpAssociation * > assocList
Definition: Sctp.h:169
uint32_t highestTsnAcked
Definition: SctpAssociation.h:605
virtual NetworkInterface * getInterface(int pos) const =0
Returns the NetworkInterface specified by an index 0..numInterfaces-1.
#define SCTP_INCOMING_RESET_REQUEST_PARAMETER_LENGTH
Definition: SctpAssociation.h:217
@ HEARTBEAT
Definition: SctpAssociation.h:106
void setSocketOptions(SocketOptions *options)
Definition: Sctp.h:254
void resetSsn(uint16_t id)
Definition: SctpAssociationStreamReset.cc:922
void sendHMacError(const uint16_t id)
Definition: SctpAssociationUtil.cc:1897
void scheduleTimeout(cMessage *msg, const simtime_t &timeout)
Utility: start a timer.
Definition: SctpAssociation.h:1185
void retransmitInit()
Retransmitting chunks.
Definition: SctpAssociationUtil.cc:756
int getAssocMaxRtx()
Definition: Sctp.h:267
SctpShutdownChunk * shutdownChunk
pointer to the resetChunk (for retransmission)
Definition: SctpAssociation.h:646
void cwndUpdateAfterRtxTimeout(SctpPathVariables *path)
Definition: SctpCcFunctions.cc:830
@ INIT_ACK
Definition: SctpAssociation.h:104
SctpParameter * incomingRequest
Definition: SctpAssociation.h:789
@ SCTP_E_DUP_RECEIVED
Definition: SctpAssociation.h:83
@ TEST_NET
Definition: Ipv4Address.h:80
@ SCTP_E_SET_STREAM_PRIO
Definition: SctpAssociation.h:95
bool addAuthChunkIfNecessary(Ptr< SctpHeader > sctpMsg, uint16_t chunkType, bool authAdded)
Definition: SctpAssociation.h:1485
SctpSuccessIndication * createSuccessIndication(uint32_t correlationId)
Definition: SctpAssociationAddIp.cc:297
void sendAsconf(const char *type, bool remote=false)
Methods for Add-IP and AUTH.
Definition: SctpAssociationAddIp.cc:15
uint8_t dacPacketsRcvd
Definition: SctpAssociation.h:924
@ SCTP_E_SEND_SHUTDOWN_ACK
Definition: SctpAssociation.h:89
uint64_t outstandingBytes
Definition: SctpAssociation.h:612
@ SCTP_E_ACCEPT
Definition: SctpAssociation.h:96
@ CCCV_CMT
Definition: SctpAssociation.h:748
#define SCTP_NRSACK_CHUNK_LENGTH
Definition: SctpAssociation.h:207
cOutVector * statisticsArwndInLastSACK
Definition: SctpAssociation.h:973
unsigned int uint
Definition: INETDefs.h:55
@ SACK
Definition: SctpAssociation.h:105
bool processCookieEchoArrived(SctpCookieEchoChunk *cookieEcho, L3Address addr)
Definition: SctpAssociationRcvMessage.cc:814
@ SCTP_E_OPEN_PASSIVE
Definition: SctpAssociation.h:63
uint64_t queuedMessages
Definition: SctpAssociation.h:628
int32_t numUsableStreams()
Definition: SctpSsFunctions.cc:163
@ FCFS
Definition: SctpAssociation.h:198
uint16_t localRequestType
Definition: SctpAssociation.h:799
uint64_t sendQueueLimit
Definition: SctpAssociation.h:648
#define SCTP_SHUTDOWN_ACK_LENGTH
Definition: SctpAssociation.h:213
void setPrimaryPath(SctpPathVariables *path)
Definition: SctpAssociation.h:536
@ CCCV_CMTRP_Test2
Definition: SctpAssociation.h:754
void addLocalAddress(SctpAssociation *assoc, L3Address address)
Definition: Sctp.cc:677
bool resetDeferred
Definition: SctpAssociation.h:776
bool peerStreamReset
Definition: SctpAssociation.h:775
void addPath(const L3Address &addr)
Definition: SctpAssociationUtil.cc:2113
SctpParameter * makeAddStreamsRequestParameter(uint32_t srsn, SctpResetReq *info)
Definition: SctpAssociationStreamReset.cc:376
uint32_t numRequests
Definition: SctpAssociation.h:621
@ SCTP_E_IGNORE
Definition: SctpAssociation.h:81
std::vector< uint16_t > chunkList
Definition: SctpAssociation.h:812
@ SCTP_C_ACCEPT
Definition: SctpCommand_m.h:151
AddressType getType() const
Definition: L3Address.cc:51
std::vector< int32_t > numMsgsReq
Definition: SctpAssociation.h:636
#define SCTP_PKTDROP_CHUNK_LENGTH
Definition: SctpAssociation.h:225
bool sendStreamPresent(uint32_t sid)
Definition: SctpAssociationStreamReset.cc:929
@ SCTP_E_SEND
Definition: SctpAssociation.h:67
double throughputInterval
Definition: SctpAssociation.h:841
void processIncomingResetRequestArrived(SctpIncomingSsnResetRequestParameter *requestParam)
Definition: SctpAssociationRcvMessage.cc:2391
void printAssocBrief()
Utility: prints local/remote addr/port and app gate index/assocId.
Definition: SctpAssociationUtil.cc:287
virtual SctpAsconfChunk * dup() const override
Definition: SctpHeader.h:177
bool incomingRequestSet
Definition: SctpAssociation.h:592
uint32_t peerRequestSn
Definition: SctpAssociation.h:784
@ CSP_RoundRobin
Definition: SctpAssociation.h:738
void initStreams(uint32_t inStreams, uint32_t outStreams)
Definition: SctpSsFunctions.cc:58
@ IFORWARD_TSN
Definition: SctpAssociation.h:122
SctpPathVariables * getNextPath(const SctpPathVariables *oldPath) const
Definition: SctpAssociationUtil.cc:2671
void sendSACKviaSelectedPath(const Ptr< SctpHeader > &sctpMsg)
Definition: SctpAssociationSendAll.cc:499
void disposeOf(SctpHeader *sctpmsg)
Definition: SctpAssociationUtil.cc:2880
bool swsMsgInvoked
Definition: SctpAssociation.h:836
@ CCCV_CMT_LIA
Definition: SctpAssociation.h:751
SctpAsconfAckChunk * createAsconfAckChunk(uint32_t serialNumber)
Definition: SctpAssociationAddIp.cc:201
@ GLOBAL
Definition: Ipv6Address.h:48
bool resetRequested
Definition: SctpAssociation.h:580
bool reactivatePrimaryPath
Definition: SctpAssociation.h:578
uint32_t getQueueSize() const
Definition: SctpQueue.cc:49
@ MBV_UseItOrLoseItTempCwnd
Definition: SctpAssociation.h:685
virtual unsigned short getRequestType() const
void sendAddInAndOutStreamsRequest(SctpResetReq *info)
Definition: SctpAssociationStreamReset.cc:697
bool ackPointAdvanced
Definition: SctpAssociation.h:564
@ PRIVATE_NETWORK
Definition: Ipv4Address.h:85
@ SCTP_C_CLOSE
Definition: SctpCommand_m.h:133
#define SCTP_TSN_GT(a, b)
Definition: SctpAssociation.h:1071
uint32_t getSsnOfStream(uint16_t id)
Definition: SctpAssociationStreamReset.cc:908
void sendAbort(uint16_t tBit=0)
Definition: SctpAssociationUtil.cc:1153
@ SCTP_I_ADDRESS_ADDED
Definition: SctpCommand_m.h:216
SctpEventCode processDataArrived(SctpDataChunk *dataChunk)
Definition: SctpAssociationRcvMessage.cc:2109
uint32_t bytesToAddPerPeerChunk
Definition: SctpAssociation.h:834
int getSackFrequency()
Definition: Sctp.h:260
SctpStateVariables * state
Definition: SctpAssociation.h:951
#define SCTP_STREAM_RESET_CHUNK_LENGTH
Definition: SctpAssociation.h:215
void stopTimer(cMessage *timer)
Definition: SctpAssociationRcvMessage.cc:3667
void(SctpAssociation::* ssAddOutStreams)(uint32_t outStreams)
Definition: SctpAssociation.h:1291
@ RESET_BOTH
Definition: SctpAssociation.h:143
void putInTransmissionQ(uint32_t tsn, SctpDataVariables *chunk)
Definition: SctpAssociationUtil.cc:2951
void advancePeerTsn()
Definition: SctpAssociationUtil.cc:2279
@ CBSV_BothSides
Definition: SctpAssociation.h:709
virtual SctpInitChunk * dup() const override
Definition: SctpHeader_m.h:318
bool fork
Definition: SctpAssociation.h:563
@ IPv6_TO_IPv4_RELAY
Definition: Ipv4Address.h:81
cOutVector * statisticsNumDuplicatesSent
Definition: SctpAssociation.h:982
@ SCTP_E_SET_RTO_INFO
Definition: SctpAssociation.h:97
uint16_t numAddedInStreams
Definition: SctpAssociation.h:662
std::vector< uint16_t > peerChunkList
Definition: SctpAssociation.h:813
CCFunctions ccFunctions
Definition: SctpAssociation.h:942
uint32_t bytesToAddPerRcvdChunk
Definition: SctpAssociation.h:833
void sendAvailableIndicationToApp()
Definition: SctpAssociationUtil.cc:452
void process_TIMEOUT_RTX(SctpPathVariables *path)
Definition: SctpAssociationRcvMessage.cc:3757
void unackChunk(SctpDataVariables *chunk)
Definition: SctpAssociation.h:1445
@ SHUTDOWN_COMPLETE
Definition: SctpAssociation.h:114
void cwndUpdateMaxBurst(SctpPathVariables *path)
Definition: SctpCcFunctions.cc:922
uint32_t inboundStreams
Definition: SctpAssociation.h:933
uint32_t prMethod
Definition: SctpAssociation.h:826
CSackPath cmtSackPath
Definition: SctpAssociation.h:741
@ SCTP_E_ASSOCIATE
Definition: SctpAssociation.h:62
@ RFC4960
Definition: SctpAssociation.h:187
void setFragInProgressOfStream(uint16_t sid, bool frag)
Definition: SctpAssociationUtil.cc:104
int getMaxBurst()
Definition: Sctp.h:262
void cucProcessGapReports(const SctpDataVariables *chunk, SctpPathVariables *path, const bool isAcked)
Definition: SctpAssociationRcvMessage.cc:935
bool waitForResponse
Definition: SctpAssociation.h:778
SctpQueue * transmissionQ
Definition: SctpAssociation.h:957
uint32_t initPeerTsn
Definition: SctpAssociation.h:939
virtual SctpParameter * dup() const override
Definition: SctpHeader_m.h:1503
@ PERFORMED
Definition: SctpAssociation.h:135
bool containsKey(const std::map< K, V, _C > &m, const Tk &a)
Definition: stlutils.h:80
void timeForSack(bool &sackOnly, bool &sackWithData)
Definition: SctpAssociationSendAll.cc:247
@ SCTP_I_AVAILABLE
Definition: SctpCommand_m.h:218
bool chunkMustBeAbandoned(SctpDataVariables *chunk, SctpPathVariables *sackPath)
Definition: SctpAssociationUtil.cc:2343
void decreaseOutstandingBytes(SctpDataVariables *chunk)
Definition: SctpAssociationRcvMessage.cc:34
uint32_t queueLimit
Definition: SctpAssociation.h:630
uint32_t asconfSn
Definition: SctpAssociation.h:767
SctpEventCode processHeartbeatAckArrived(SctpHeartbeatAckChunk *heartbeatack, SctpPathVariables *path)
Definition: SctpAssociationRcvMessage.cc:2271
for(int index=0;index< array->size();index++)
Definition: NedFunctions.cc:229
@ CSP_Primary
Definition: SctpAssociation.h:737
virtual SctpCookie * dup() const override
Definition: SctpHeader_m.h:678
SctpDataVariables * getOutboundDataChunk(const SctpPathVariables *path, int32_t availableSpace, int32_t availableCwnd)
Definition: SctpAssociationUtil.cc:2301
int32_t streamSchedulerFairBandwidth(SctpPathVariables *path, bool peek)
Definition: SctpSsFunctions.cc:318
void cwndUpdateAfterSack()
Definition: SctpCcFunctions.cc:433
CCCVariant cmtCCVariant
Definition: SctpAssociation.h:756
bool(* cmtSendAllComparisonFunction)(const SctpPathVariables *left, const SctpPathVariables *right)
Definition: SctpAssociation.h:695
uint32_t getHighestTsnReceived() const
Definition: SctpGapList.h:84
@ SCTP_C_ADD_STREAMS
Definition: SctpCommand_m.h:146
bool peerWindowFull
Definition: SctpAssociation.h:585
uint32_t assocPmtu
Definition: SctpAssociation.h:617
void checkStreamsToReset()
Definition: SctpAssociationStreamReset.cc:53
uint16_t getEphemeralPort()
To be called from SctpAssociation: reserves an ephemeral port for the connection.
Definition: Sctp.cc:634
void sendDoubleStreamResetResponse(uint32_t insrrsn, uint16_t inresult, uint32_t outsrrsn, uint16_t outresult)
Definition: SctpAssociationStreamReset.cc:842
@ THIS_NETWORK
Definition: Ipv4Address.h:75
void recordCwndUpdate(SctpPathVariables *path)
Definition: SctpCcFunctions.cc:354
@ RANDOM_SCHEDULE_PACKET
Definition: SctpAssociation.h:194
int32_t getOutstandingBytes() const
Definition: SctpAssociationUtil.cc:2799
void sendEstabIndicationToApp()
Utility: sends SCTP_I_ESTABLISHED indication with SctpConnectInfo to application.
Definition: SctpAssociationUtil.cc:472
@ DENIED
Definition: SctpAssociation.h:136
void scheduleSack()
Definition: SctpAssociationUtil.cc:1324
void dequeueAckedChunks(const uint32_t tsna, SctpPathVariables *path, simtime_t &rttEstimation)
Definition: SctpAssociationRcvMessage.cc:2028
@ SCTP_E_STOP_SENDING
Definition: SctpAssociation.h:90
static bool tsnLt(const uint32_t tsn1, const uint32_t tsn2)
Definition: SctpAssociation.h:1078
void removePath()
Definition: SctpAssociationBase.cc:1801