Apunte de End to End (Teoría de las Comunicaciones)

De Cuba-Wiki
Saltar a: navegación, buscar
Back.png Volver a la página de la materia

Needs cleanup!

Header[editar]

SrcPort
DestPort
SequenceNum
Acknowledgment
HdrLen
0
Flags
AdvertisedWindow
Checksum
UrgPtr
Options (variable)
Data

Connection Setup[editar]

SYN, SequenceNum = x
SYN + ACK, SequenceNum = y, Acknowledgment = x + 1
ACK, Acnkowledment = y + 1

Invariants[editar]

LastByteAcked LastByteSent
LastByteSent LastByteWritten
LastByteRead NextByteExpected
NextByteExpected LastByteRcvd + 1

Fórmulas[editar]

Flow Control[editar]

Invariants[editar]

LastByteRcvd - LastByteRead MaxRcvBuffer


EffectiveWindow = AdvertisedWindow - (LastByteSent - LastByteAcked)
LastByteWritten - LastByteAcked MaxSendBuffer
(LastByteWritten - LastByteAcked) + y MaxSendBuffer

Original Algorithm[editar]



Jacobson/Karels Algorithm[editar]





Actually:
Implementation:

{
  SampleRTT -= (EsimatedRTT >> 3);
  EsimatedRTT += SampleRTT;
  if (SampleRTT < 0)
  {
      SampleRTT = -SampleRTT;
  }
  SampleRTT -= (Deviation >> 3);
  Deviation += SampleRTT;
  TimeOut = (EstimatedRTT >> 3) + (Deviation >> 1);
}

Something[editar]

 When the application produces data to send
if both the avaiable data and the window MSS
send a full segment
else
if there is unACKed data in flight
buffer the new data until an ACK arrives
else
send all the new data now

TCP Congestion Control[editar]

Formulas[editar]


Additive Increase / Multiplicative Decrease[editar]





Slow Start[editar]

{
  int cw = state->CongestionWindow;
  int incr = state->maxseg;
  if (cw > state->CongestionThreshold)
  {
    incr = incr * incr / cw;
  }
  state->CongestionWindow = MIN(cw + incr, TCP_MAXWIN);
}