35 votos

El receptor limita el tamaño de la ventana TCP a 64.512

Hechos (identifique las declaraciones falsas):

  1. Tengo una conexión de 100 Mbps entre dos sitios que están a 80 ms de distancia

  2. Se trata de una conexión larga y gorda que podría beneficiarse de un tamaño de ventana TCP grande, tal vez de hasta 100 Mbps * 0,08 segundos = 1.000.000 de bytes

  3. Ambas máquinas están ejecutando Windows Server 2012. "El nivel de ajuste automático de la ventana de recepción es normal en ambos. La "heurística de escalado de ventanas" está desactivada en ambos.

  4. He ejecutado "iperf -s" en un lado y "iperf -c" en el otro. La transferencia se produjo a 5 Mbps. Obtengo el mismo resultado yendo en la otra dirección.

  5. Ambas partes anunciaron el soporte para TCP sliding Windows en sus SYNs.

  6. El receptor solicitó un tamaño de ventana TCP de 64.512 bytes (0xFC00) durante toda la ejecución con un valor de escala de ventana TCP de "sin desplazamiento" (0x000).

  7. La red fue capaz de manejar un tamaño de ventana mayor (véase la secuencia diagramas de secuencia)

  8. El receptor mantuvo la ventana más pequeña que la red soporta

  9. Esta conexión se produce dentro de una VPN IPSEC. La MTU de la interfaz del túnel se reduce a 1400 bytes en ambas direcciones.

Pregunta

  • ¿Por qué el receptor mantiene la ventana pequeña?

Sin respuestas

  • La red está rota

    Las máquinas Linux que se ejecutan en la misma red abren la ventana TCP a 1,5 megabytes y transmiten datos a un ancho de banda 6 veces mayor

  • La heurística de escalado de ventanas está activada

    La heurística de escalado de ventanas está desactivada (véase la salida de "netsh interface tcp show heuristics" más abajo)

  • El nivel de sintonía automática de la ventana de recepción no es normal

    El nivel de ajuste automático de la ventana de recepción es normal (véase la salida de "netsh interface tcp show global" a continuación)

  • Esto no funciona bien en una máquina virtual dentro de ESXi

    Obtengo un rendimiento 6 veces mayor en una máquina virtual de linux que se ejecuta en el mismo host.


Actualización 1 12 de junio de 2015 4:30 pm PDT

He modificado la prueba poniendo linux en un lado de la conexión. Efectivamente, cuando linux envía datos a Windows Server 2012, Windows ofrece una ventana de recepción TCP demasiado pequeña (64.512 bytes).

Cuando envío datos desde Windows a linux, éste ofrece una ventana de recepción TCP suficientemente grande (1.365.120 bytes). Sin embargo, Windows restringe los envíos a un máximo de ~60.000 bytes en vuelo.


Actualización 2 13 de junio de 2015 3:00 pm PDT

Un paso más cerca de la causa root. En mi configuración, ni SO_SNDBUF ni SO_RCVBUF están establecidos (por iperf). Estos son los buffers de envío y recepción que efectivamente limitan la ventana de recepción. Cuando no se especifican estos valores, Windows Server 2012 proporciona un valor por defecto de 64 kB. Así que la pregunta es ahora:

Pregunta

  • Cuando no se especifica uno, ¿por qué Windows Server 2012 no aumenta dinámicamente SO_SNDBUF/SO_RCVBUF para acomodar las tuberías gruesas largas como se describe en MSDN ?

Sin respuestas

  • "netsh winsock show autotuning" está desactivado

    Está habilitado.


Actualización 3 24 de agosto de 2015 4:00 pm PDT

netsh aparentemente ha sido reemplazado por Set-NetTCPSetting y familia. Get-NetTCPSetting combinado con Get-NetTCPConnection muestra que estoy operando en el régimen de 'Internet' que me ofrece estos ajustes:

SettingName                   : Internet
MinRto(ms)                    : 300
InitialCongestionWindow(MSS)  : 4
CongestionProvider            : CTCP
CwndRestart                   : False
DelayedAckTimeout(ms)         : 50
MemoryPressureProtection      : Enabled
AutoTuningLevelLocal          : Normal
AutoTuningLevelGroupPolicy    : NotConfigured
AutoTuningLevelEffective      : Local
EcnCapability                 : Enabled
Timestamps                    : Disabled
InitialRto(ms)                : 3000
ScalingHeuristics             : Disabled
DynamicPortRangeStartPort     : 49152
DynamicPortRangeNumberOfPorts : 16384

Configuración TCP del remitente

PS C:\Users\acs> netsh interface tcp show global
Querying active state...

TCP Global Parameters
----------------------------------------------
Receive-Side Scaling State          : enabled
Chimney Offload State               : disabled
NetDMA State                        : disabled
Direct Cache Access (DCA)           : disabled
Receive Window Auto-Tuning Level    : normal
Add-On Congestion Control Provider  : none
ECN Capability                      : enabled
RFC 1323 Timestamps                 : disabled
Initial RTO                         : 3000
Receive Segment Coalescing State    : enabled

PS C:\Users\acs> netsh interface tcp show heuristics
TCP Window Scaling heuristics Parameters
----------------------------------------------
Window Scaling heuristics         : disabled
Qualifying Destination Threshold  : 3
Profile type unknown              : normal
Profile type public               : normal
Profile type private              : normal
Profile type domain               : normal

PS C:\Users\acs> Get-NetTCPSetting

SettingName                   : Automatic
MinRto(ms)                    : 
InitialCongestionWindow(MSS)  : 
CongestionProvider            : 
CwndRestart                   : 
DelayedAckTimeout(ms)         : 
MemoryPressureProtection      : 
AutoTuningLevelLocal          : 
AutoTuningLevelGroupPolicy    : 
AutoTuningLevelEffective      : 
EcnCapability                 : 
Timestamps                    : 
InitialRto(ms)                : 
ScalingHeuristics             : 
DynamicPortRangeStartPort     : 
DynamicPortRangeNumberOfPorts : 

SettingName                   : Custom
MinRto(ms)                    : 20
InitialCongestionWindow(MSS)  : 4
CongestionProvider            : DCTCP
CwndRestart                   : True
DelayedAckTimeout(ms)         : 10
MemoryPressureProtection      : Enabled
AutoTuningLevelLocal          : Normal
AutoTuningLevelGroupPolicy    : NotConfigured
AutoTuningLevelEffective      : Local
EcnCapability                 : Enabled
Timestamps                    : Disabled
InitialRto(ms)                : 3000
ScalingHeuristics             : Disabled
DynamicPortRangeStartPort     : 49152
DynamicPortRangeNumberOfPorts : 16384

SettingName                   : Compat
MinRto(ms)                    : 300
InitialCongestionWindow(MSS)  : 2
CongestionProvider            : Default
CwndRestart                   : False
DelayedAckTimeout(ms)         : 200
MemoryPressureProtection      : Enabled
AutoTuningLevelLocal          : Normal
AutoTuningLevelGroupPolicy    : NotConfigured
AutoTuningLevelEffective      : Local
EcnCapability                 : Enabled
Timestamps                    : Disabled
InitialRto(ms)                : 3000
ScalingHeuristics             : Disabled
DynamicPortRangeStartPort     : 49152
DynamicPortRangeNumberOfPorts : 16384

SettingName                   : Datacenter
MinRto(ms)                    : 20
InitialCongestionWindow(MSS)  : 4
CongestionProvider            : DCTCP
CwndRestart                   : True
DelayedAckTimeout(ms)         : 10
MemoryPressureProtection      : Enabled
AutoTuningLevelLocal          : Normal
AutoTuningLevelGroupPolicy    : NotConfigured
AutoTuningLevelEffective      : Local
EcnCapability                 : Enabled
Timestamps                    : Disabled
InitialRto(ms)                : 3000
ScalingHeuristics             : Disabled
DynamicPortRangeStartPort     : 49152
DynamicPortRangeNumberOfPorts : 16384

SettingName                   : Internet
MinRto(ms)                    : 300
InitialCongestionWindow(MSS)  : 4
CongestionProvider            : CTCP
CwndRestart                   : False
DelayedAckTimeout(ms)         : 50
MemoryPressureProtection      : Enabled
AutoTuningLevelLocal          : Normal
AutoTuningLevelGroupPolicy    : NotConfigured
AutoTuningLevelEffective      : Local
EcnCapability                 : Enabled
Timestamps                    : Disabled
InitialRto(ms)                : 3000
ScalingHeuristics             : Disabled
DynamicPortRangeStartPort     : 49152
DynamicPortRangeNumberOfPorts : 16384

Remitente SYN

No.     Time           Source                Destination           Protocol Length Delta      Sequence number Acknowledgment number Bytes in flight Calculated window size Info
    814 5.036577000    10.10.0.21            10.11.0.1             TCP      66     0.000000000 0               0                                     64512                  497585001 [SYN, ECN, CWR] Seq=0 Win=64512 Len=0 MSS=1460 WS=1 SACK_PERM=1

Frame 814: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) on interface 0
Ethernet II, Src: 00:11:22:33:44:55, Dst: aa:bb:cc:dd:ee:ff
Internet Protocol Version 4, Src: 10.10.0.21 (10.10.0.21), Dst: 10.11.0.1 (10.11.0.1)
Transmission Control Protocol, Src Port: 49758 (49758), Dst Port: 5001 (5001), Seq: 0, Len: 0
    Source Port: 49758 (49758)
    Destination Port: 5001 (5001)
    [Stream index: 73]
    [TCP Segment Len: 0]
    Sequence number: 0    (relative sequence number)
    Acknowledgment number: 0
    Header Length: 32 bytes
    .... 0000 1100 0010 = Flags: 0x0c2 (SYN, ECN, CWR)
    Window size value: 64512
    [Calculated window size: 64512]
    Checksum: 0x1451 [validation disabled]
    Urgent pointer: 0
    Options: (12 bytes), Maximum segment size, No-Operation (NOP), Window scale, No-Operation (NOP), No-Operation (NOP), SACK permitted
        Maximum segment size: 1460 bytes
        No-Operation (NOP)
        Window scale: 0 (multiply by 1)
            Kind: Window Scale (3)
            Length: 3
            Shift count: 0
            [Multiplier: 1]
        No-Operation (NOP)
        No-Operation (NOP)
        TCP SACK Permitted Option: True

Perspectiva del remitente del gráfico de la secuencia enter image description here

enter image description here

Configuración TCP del receptor

PS C:\Users\acs> netsh interface tcp show global
Querying active state...

TCP Global Parameters
----------------------------------------------
Receive-Side Scaling State          : enabled
Chimney Offload State               : disabled
NetDMA State                        : disabled
Direct Cache Access (DCA)           : disabled
Receive Window Auto-Tuning Level    : normal
Add-On Congestion Control Provider  : none
ECN Capability                      : enabled
RFC 1323 Timestamps                 : disabled
Initial RTO                         : 3000
Receive Segment Coalescing State    : enabled

PS C:\Users\acs> netsh interface tcp show heuristics
TCP Window Scaling heuristics Parameters
----------------------------------------------
Window Scaling heuristics         : disabled
Qualifying Destination Threshold  : 3
Profile type unknown              : normal
Profile type public               : normal
Profile type private              : normal
Profile type domain               : normal

PS C:\Users\acs> Get-NetTCPSetting

SettingName                   : Automatic
MinRto(ms)                    : 
InitialCongestionWindow(MSS)  : 
CongestionProvider            : 
CwndRestart                   : 
DelayedAckTimeout(ms)         : 
MemoryPressureProtection      : 
AutoTuningLevelLocal          : 
AutoTuningLevelGroupPolicy    : 
AutoTuningLevelEffective      : 
EcnCapability                 : 
Timestamps                    : 
InitialRto(ms)                : 
ScalingHeuristics             : 
DynamicPortRangeStartPort     : 
DynamicPortRangeNumberOfPorts : 

SettingName                   : Custom
MinRto(ms)                    : 20
InitialCongestionWindow(MSS)  : 4
CongestionProvider            : DCTCP
CwndRestart                   : True
DelayedAckTimeout(ms)         : 10
MemoryPressureProtection      : Enabled
AutoTuningLevelLocal          : Normal
AutoTuningLevelGroupPolicy    : NotConfigured
AutoTuningLevelEffective      : Local
EcnCapability                 : Enabled
Timestamps                    : Disabled
InitialRto(ms)                : 3000
ScalingHeuristics             : Disabled
DynamicPortRangeStartPort     : 49152
DynamicPortRangeNumberOfPorts : 16384

SettingName                   : Compat
MinRto(ms)                    : 300
InitialCongestionWindow(MSS)  : 2
CongestionProvider            : Default
CwndRestart                   : False
DelayedAckTimeout(ms)         : 200
MemoryPressureProtection      : Enabled
AutoTuningLevelLocal          : Normal
AutoTuningLevelGroupPolicy    : NotConfigured
AutoTuningLevelEffective      : Local
EcnCapability                 : Enabled
Timestamps                    : Disabled
InitialRto(ms)                : 3000
ScalingHeuristics             : Disabled
DynamicPortRangeStartPort     : 49152
DynamicPortRangeNumberOfPorts : 16384

SettingName                   : Datacenter
MinRto(ms)                    : 20
InitialCongestionWindow(MSS)  : 4
CongestionProvider            : DCTCP
CwndRestart                   : True
DelayedAckTimeout(ms)         : 10
MemoryPressureProtection      : Enabled
AutoTuningLevelLocal          : Normal
AutoTuningLevelGroupPolicy    : NotConfigured
AutoTuningLevelEffective      : Local
EcnCapability                 : Enabled
Timestamps                    : Disabled
InitialRto(ms)                : 3000
ScalingHeuristics             : Disabled
DynamicPortRangeStartPort     : 49152
DynamicPortRangeNumberOfPorts : 16384

SettingName                   : Internet
MinRto(ms)                    : 300
InitialCongestionWindow(MSS)  : 4
CongestionProvider            : CTCP
CwndRestart                   : False
DelayedAckTimeout(ms)         : 50
MemoryPressureProtection      : Enabled
AutoTuningLevelLocal          : Normal
AutoTuningLevelGroupPolicy    : NotConfigured
AutoTuningLevelEffective      : Local
EcnCapability                 : Enabled
Timestamps                    : Disabled
InitialRto(ms)                : 3000
ScalingHeuristics             : Disabled
DynamicPortRangeStartPort     : 49152
DynamicPortRangeNumberOfPorts : 16384

Receptor SYN

No.     Time           Source                Destination           Protocol Length Delta      Sequence number Acknowledgment number Bytes in flight Calculated window size Info
    817 5.110501000    10.11.0.1             10.10.0.21            TCP      70     0.073924000 0               1                                     64512                  500149758 [SYN, ACK, ECN] Seq=0 Ack=1 Win=64512 Len=0 MSS=1460 WS=1 SACK_PERM=1 [ETHERNET FRAME CHECK SEQUENCE INCORRECT]

Frame 817: 70 bytes on wire (560 bits), 70 bytes captured (560 bits) on interface 0
Ethernet II, Src: aa:bb:cc:dd:ee:ff, Dst: 00:11:22:33:44:55
Internet Protocol Version 4, Src: 10.11.0.1 (10.11.0.1), Dst: 10.10.0.21 (10.10.0.21)
Transmission Control Protocol, Src Port: 5001 (5001), Dst Port: 49758 (49758), Seq: 0, Ack: 1, Len: 0
    Source Port: 5001 (5001)
    Destination Port: 49758 (49758)
    [Stream index: 73]
    [TCP Segment Len: 0]
    Sequence number: 0    (relative sequence number)
    Acknowledgment number: 1    (relative ack number)
    Header Length: 32 bytes
    .... 0000 0101 0010 = Flags: 0x052 (SYN, ACK, ECN)
    Window size value: 64512
    [Calculated window size: 64512]
    Checksum: 0xb5bb [validation disabled]
    Urgent pointer: 0
    Options: (12 bytes), Maximum segment size, No-Operation (NOP), Window scale, No-Operation (NOP), No-Operation (NOP), SACK permitted
        Maximum segment size: 1460 bytes
        No-Operation (NOP)
        Window scale: 0 (multiply by 1)
            Kind: Window Scale (3)
            Length: 3
            Shift count: 0
            [Multiplier: 1]
        No-Operation (NOP)
        No-Operation (NOP)
        TCP SACK Permitted Option: True
    [SEQ/ACK analysis]

Perspectiva del receptor del gráfico de la secuencia enter image description here enter image description here

Ventana TCP enter image description here

1voto

genesiss Puntos 919

He visto esto como un problema específico de los controladores; en mi caso con controladores de red QLogic que intentaban usar TCPChimney. Este enlace describe la funcionalidad TCPChimney añadido en Windows 2008 - pero estoy bastante seguro de que todavía se aplica: https://support.microsoft.com/en-us/kb/951037

Yo recomendaría probar lo siguiente, en orden; después de cada prueba, reiniciar y ver si el receptor comienza a aumentar el RWIN TCP como se espera.

1) Cargue las últimas versiones de los controladores del adaptador de red en el ordenador receptor. 1) Desactivar TCPChimney en el ordenador receptor 2) Desactivar toda la descarga de 'TCP Receive'. Esto se encuentra en la configuración avanzada de las propiedades del adaptador de red (la misma área en la que se establece la velocidad y el dúplex). 3) Desactivar todas las descargas de "envío TCP" (también en las propiedades avanzadas del adaptador de red)

( Y al contrario del comentario "Y los tamaños de ventana TCP grandes, por encima de 65k, son malos para los servidores, ya que entonces aumenta la demanda de memoria para las conexiones. 65k por sí solo también podría no ser lo suficientemente feliz. - user303507 Aug 6 '15 at 11:30", las ventanas de recepción TCP grandes NO son inherentemente malas para el servidor. En el caso de enlaces de gran ancho de banda y alta latencia (como los relés de satélite), los valores grandes de RWIN son necesarios para que tengamos más datos TCP "en la tubería". Imagina una conexión de 600 Mbps con 3000 ms de latencia; el enlace de gran ancho de banda estaría limitado a unos 20 KBps ;ya que sólo 65 KB de datos TCP sin empaquetar podrían estar "en la tubería" a la vez. )

0voto

A mí me parece un error de sintonización automática de Windows, ¿tal vez algo relacionado con esto? https://support.microsoft.com/en-us/kb/932170

¿Has probado a solicitar manualmente un valor mayor de SO_RCVBUF mediante WskControlSocket?

0voto

user303507 Puntos 1

Utilice un optimizador de red como Cisco WAAS o Riverbed. Hacen acks locales rápidamente, por lo que no es necesario preocuparse por la configuración del servidor. En una red más grande no tienes influencia en la configuración del servidor, ya que estos son otros equipos o esto se subcontrata.

0voto

Sameer Segal Puntos 6268

Aquí está algunas informaciones He descubierto que puede ser la respuesta que está buscando. Ten en cuenta que la mención del límite de 64kb en el modo desactivado puede ser una pista de límites similares en el modo normal que no están documentados.

Prueba a activar el modo "experimental" para los niveles astronómicos de Auto-Tuning.

Al establecer el nivel de sintonización automática de Windows, los posibles ajustes son los siguientes:

  • normal: valor por defecto, permite que la ventana de recepción crezca para adaptarse a la mayoría de las condiciones
  • disabled: utiliza un valor fijo para la ventana de recepción tcp. La limita a 64KB (limitada a 65535).
  • altamente restringido: permite que la ventana de recepción crezca más allá de su valor por defecto, de forma muy conservadora
  • restricted: crecimiento algo restringido de la ventana de recepción tcp más allá de su valor por defecto
  • experimental: permite que la ventana de recepción crezca para adaptarse a escenarios extremos (no se recomienda, puede degradar el rendimiento en escenarios comunes, sólo está pensado para fines de investigación. Permite que RWIN de más de 16 MB)

EnMiMaquinaFunciona.com

EnMiMaquinaFunciona es una comunidad de administradores de sistemas en la que puedes resolver tus problemas y dudas.
Puedes consultar las preguntas de otros sysadmin, hacer tus propias preguntas o resolver las de los demás.

Powered by:

X