WhitePaperiSCP(intdashStreamControlProtocol)
30thMay,2018©2018aptpod,Inc.Duplicationwithoutpermissionisprohibited.Thiscontentisintendedonlytosupplyinformation.
aptpoddoesnotguaranteetheinformationshowninthisdocument,implicitlyorexplicitly,atall.

1

iSCP(intdashStreamControlProtocol)
iSCP(intdashStreamControlProtocol)isaprotocolthataptpodoriginallydevelopedandthatisusedforinternalcommunicationofmodulestorealizeeachfunctionofintdash.iSCPisusedfordatastreamingbetweenarelaybrokerofstreamingdataandthemoduleofanedgedevicetodeliverthemainfunctionsofintdash,suchascompletecollection,efficienttransmission,andflowcontrol.

ProtocolStack
ThecurrentversionofiSCPusesWebSocketSecureastransport.Theadvantagesofemploying
WebSocketareasfollows:
BidirectionalsocketcommunicationalmostsameasTCP/TLSispossible
Pathcompressionfunctionsupportedatprotocollevel
HTTPportused,makingtheprotocolhardtobecutoffbyproxyorfirewall
Developmentcostcanbeloweredbyusingservicesforwebsystems
ThedisadvantageisthatreductionoftransmissionefficiencybyaheaderissuppressedbythefunctionoftransmissionbufferingequippedtoiSCP,eventhoughtherearepointswherea
WebSocketheaderisappendedasextraoverhead.
However,WebSocketisaTCP-basedprotocolandnotanoptimumsolutionforusecaseswithstrict
requirementsondelay,suchasteleoperation.aptpodexpectsthatsuchstrictrequirementswill
increaseandhasstartedaninvestigationandstudyonusingQUIC,anewprotocolbasedonUDP,
andUDP/DTLSastransport.

2

DataFormat
Asdatastructuresfortransmission,aUnitstructurethatindicatesthedataitselfthathasbeengenerated,aSectionstructureforcompletecollection,andaFlushstructureforefficienttransmissionareimportant.

UnitStructureAlltime-seriesdatathathavebeengeneratedarestoredinastructurecalledaUnit.AUnit
structureconsistsofastreamIDtoidentifyastream,elapsedtimeindicatingtimeofoccurrence,payload,whichisthemainbodyofthedata,andotherdetailedmetainformation.

SectionStructureAunitstoringtimeseriesdatabecomesasectionwhenamarkercalledSectionMarker(SOSandEOS[1])isattachedtothefrontandback.ThissectionissuccessivelystreamedthroughasecurecommunicationpathformedbyWebSocketSecure.
Asectionisastructureforacompletecollection,asmentionedabove,andasequentialnumber
thatisusedtocheckalossisstoredintheSectionMarkerstobeappended.AserverthathasreceivedaSectionreturnsACKtotheedgedeviceaftercompletionofpersistence,completingasequenceforcompletelycollectingdatathathasbeengenerated.
Itcanbeexpected,bylengtheningaSection,thattheprocessingloadoftheedgedeviceandservercanbealleviatedbyreducingthenumberoftimesofreturningandcheckingACKandthenumberoftimesofI/Oprocessingforpersistence.Ontheotherhand,therearedisadvantages
suchthattheunitinwhichdatamustberetransmittedincasealossoccursincreasesandthattheretransmissionqueueoftheedgedeviceandthebufferoftheservertendtobecomelong.Itisnecessarytodecideinaccordancewiththerequirementsoftheapplicationhowmanyunitsarecombinedintoasection.

3

FlushStructure
WhenasectionistransmittedoverWebSocketSecure,anenumerationofunitsandsection
markersisactuallytransmitted.Flushisaunitoftransmissiontobuffertheseunitsandsection
markersforaspecificperiodandtransmitthemallatonce.
Byusingalongflush,improvementsofthetransmissionefficiency,suchasadecreaseinthenumberoftransmission/receptionrequeststothenetworkandadeclineintheoverheadowingtoaheader,canbeexpected.Ontheotherhand,thelengthofaflush,likethatofasection,mustbesetaccordingtotherequirementsoftheapplicationbecauseabufferingdelayisadded.

4

CompleteCollectionSequence
CompletecollectionwithiSCPismaterializedbycheckingarrivalatadatastoreinsectionunits.
Atthesideofanedgedevice,datathathavebeengeneratedisbufferedandputtogetherintoaflushandsenttotheserver.Aserverthathasreceivedtheflushimmediatelytransfersittothereceiveredgedeviceand,atthesametime,sequentiallychecksunitsandsectionmarkersthatwerecombinedintotheflushtoextractsections.Whensectionshavebeenextracted,allunits
containedarepersistedtoadatastoreandSectionACKisreturnedtotheedgedevice.
Meanwhile,theedgedevicemonitorsthesectionstransmittedtotheserverforreturningofSectionACKuntilthespecifiedtimehaselapsed.ForsectionstowhichSectionACKwasnotreturnedevenafterthetimehaselapsed,thecontainedunitsaremovedtoaretransmittedstream.
Theretransmittedstreamperiodicallymonitorsunitsthataretoberetransmittedandexecutes
retransmissionifthereareunitsthatmustberetransmitted.

Notethat,althoughiSCPguaranteestheintegrityofdatatobepersisted,itdoesnotguaranteetheintegrityofdatatobestreamedinreal-time.ThecurrentversionofiSCPassumesuseofWebSocket
Securefortransfer.ItisthereforeexpectedtomakeupforalossandguaranteeasequenceinamannerequivalenttoTCP/TLS,butdoesnotperformanyadditionalprocessingtobringtransmissiondelayundercontrol.Itshouldalsobenotedthataflowofdatamaybeintentionallysuppressedbyadynamicfilterdescribedbelow.

5

NegotiationSequence
iSCPdefinesaprocedureofnegotiationthatiscarriedoutbeforethestartoftransmissionorreception.Bynegotiation,metainformationthathasnotchangedduringcommunicationisshared
betweenthetransmitterandreceiverandthequantityofdatatobetransmittedduringstreamingisreduced.
Negotiationcomesintwotypes:upstreamnegotiationthatisusedinthedirectionoftransmission
fromanedgedevicetoabrokeranddownstreamnegotiationthatisusedinthedirectionoftransmissionfromthebrokertotheedgedevice.
Upstreamnegotiationgeneratesnewmeasurementasnecessary.Creatingmeasurementisnotessentialforstartingstreamingasexistingmeasurementdata.Whencreationofmeasurementisover,astaticmetainformationsharingsequenceisstartedandastreamisopened,sharingthemeasurementID,transmissionsourceedgeID,transmissiondestinationedgeIDs(plural),persistenceneedflag,andretransmissionflag.
DownstreamnegotiationfirstopensastreambysharingthetransmissionsourceedgeIDandtransmissiondestinationedgeIDsinastaticmetainformationsharingsequence.Afterthat,thetypeofthedatatransmittedfromtheserverineachstreamissetinareceiveddatafilteringsettingsequence.

6

Theupstreamordownstreamthathasbeenopenedbynegotiationisdistinguishedatthe
receptionsidebyastreamIDsothatitcanbetransmittedmultiplexedintooneconnection.

7