View
883
Download
0
Category
Preview:
Citation preview
@toddlmontgomery
pro·to·col noun \ˈprō-tə-ˌko ̇l, -ˌkōl, -ˌkäl, -kəl\
...
3 b : a set of conventions governing the treatment and especially the formatting of data in an electronic communications system <network protocols>
...
3 a : a code prescribing strict adherence to correct etiquette and precedence (as in diplomatic exchange and in the military services) <a breach of protocol>
In an emerging era of micro-services,protocols of interaction matter
Protocols are a rich source of solutionsto micro-service problems
AlgorithmsPerformanceConcurrency
Security
Multi-Disciplinary
Number TheoryStatistics
Graph TheoryBiology ?!
TCP connections can…
be closedunexpectedly
end in anunknown state
be interceptedby idiots, er Proxies
Duplicated
Re-Ordered
Lost
Which meansData over TCP* might be…
* - When connections are re-established
@toddlmontgomery
SyncRequests
&Responses
Request
Request
RequestResponse
Response
Response
Throughput limited by Round-Trip Time (RTT)!
@toddlmontgomery
AsyncRequests
&Responses
Request
Request
RequestResponse
Response
Response
Throughput less limited by Round-Trip Time!
@toddlmontgomery
AsyncRequests
&Responses
Correlation!
Request 0
Request 1
Request 2Response 0
Response 1
Response 2
@toddlmontgomery
AsyncRequests
&Responses
Correlation!
Request 0
Request 1
Request 2Response 0
Response 1
Response 2
@toddlmontgomery
Correlation!
Request 0
Request 1
Request 2Response 0
Response 1
Response 2
Ordering
@toddlmontgomery
Correlation!
Request 0
Request 1
Request 2
Response 0
Response 1
Response 2
(Valid)Re-Ordering
@toddlmontgomery
Handling the Unexpected
Request 0
Response 1
Invalid, Drop We only know of 0.1 is unknown!
@toddlmontgomery
Interval = N x “typical” RTT
Account for processing delay
XTi
meo
ut In
terv
al
“Average”
@toddlmontgomery
Measure! But very “noisy”?
RTT
Mea
sure
men
t
Variances inprocessing,
transmission,etc.
TCP Retransmit Timeout (RTO)
Err = M - A A <- A + gErrD <- D + h(|Err| - D)RTO = A + 4D
M = measurement, A = smoothed average, D = smoothed mean deviation,
g and h = gain constants (0 to 1)
TCP Retransmit Timeout (RTO)
Err = M - A A <- A + gErrD <- D + h(|Err| - D)RTO = A + 4D
Do you measure on a Retransmit? NO!
@toddlmontgomery
Does processing twice hurt?
X
Original
ACK
Retrans
Process Once
Process Twice
Tim
eout
Inte
rval
@toddlmontgomery
Are Original & Retransmit treated the same?
X
Original
ACK
Retrans
Process Once
Process Twice
Tim
eout
Inte
rval
@toddlmontgomery
Request
ACK
Service Ais Alive!
Service Bis Alive!
Service A Service B
Consequence of Processing
@toddlmontgomery
Keepalive
Keepal
ive
Service Ais Alive!
Service Bis Alive!
Service A Service B
Absence of Processing
RIP Route Deletion
Step 0 - route info broadcast @30 secondsStep 1 (3 min) - Set Distance to Infinity (16) Step 2 (+1 min) - Delete Route
Aside… RIP… aptly named
@toddlmontgomery
Bye
Bye
Service Ais gone!
Service Bis gone!
Service A Service B
Optimization, but insufficient with arbitrary failures
Request X
Request X
Request X
Request X, X, X
Multiple same/similar requests at the same time
Response X, X, X
Optimal Multicast Feedback
double RandomBackoff(double T_maxBackoff, double groupSize){ double lambda = log(groupSize) + 1; double x = UniformRand(lambda/T_maxBackoff) + lambda / (T_maxBackoff*(exp(lambda)-1));
return ((T_maxBackoff/lambda) * log(x*(exp(lambda)-1)*(T_maxBackoff/lambda)));}
Truncated Exponential Distribution
Request 2
Request 2
Request 2, 2
Must also shed duplicates on the responder
Response 2, 2
Shed second “Request 2” if too soon
X
X
SRMPGMAeron
…
http://en.wikipedia.org/wiki/Scalable_Reliable_Multicasthttp://www.eurecom.fr/en/publication/107/detail/optimal-multicast-feedback
@toddlmontgomery
Data
Data
DataACK
ACK
ACK
Throughput = Data Length / RTT
RTT
Stop-And-WaitFlow Control
TCPAeron
…
http://en.wikipedia.org/wiki/TCP_congestion-avoidance_algorithm
CoDel
locally minimize delay in queuecombat bufferbloat
http://en.wikipedia.org/wiki/CoDel
Protocols are a rich source ofsolutions to complicated problems
Protocols of interaction matter & canbe tremendously impactful for
better or worse…
@toddlmontgomery
Questions?
• IETF http://www.ietf.org/• Aeron https://github.com/real-logic/Aeron• SlideShare http://www.slideshare.com/toddleemontgomery• Twitter @toddlmontgomery
Thank You!
Recommended