Il
Transmission Control Protocol (TCP) è uno dei principali protocolli su cui si basano le connessioni tra computer sulla rete Internet. Permette di trasmettere un insieme di dati scomponendolo in tanti pacchetti di cui ne controlla dimensione e velocità di invio, riassemblarli, ordinarli ed eventualmente chiedere la ritrasmissione dei pacchetti che per qualche motivo non sono giunti a destinazione. Le sue caratteristiche lo rendono ideale per il trasferimento di file (email, web, e la maggior parte dei servizi Internet utilizzano questo sistema).
Siccome in un percorso tra due computer (tutti i collegamenti da attraversare per raggiungere due punti sulla rete) non è possibile sapere quanta "banda passante" sia disponibile e siccome essa può variare anche rapidamente (per esempio quando più connessioni vengono aperte sullo stesso collegamento), il TCP deve regolare in continuazione la velocità con cui vengono inviati i dati. Per utilizzare meglio la banda disponibile il TCP non aspetta di sapere che il destinatario abbia ricevuto un pacchetto per inviare il successivo poichè a causa della "
latenza" della rete le prestazioni sarebbero molto scarse. Viene adottato un sistema, chiamato "
window", che consiste nell'inviare una certa quantità di dati prima di ottenere una conferma di ricezione. Questa window, nell'implementazione originale del protocollo TCP può variare da 0 a 64Kbyte.
Con l'implementazione di reti sempre più veloci 64Kbyte sono troppo pochi per usare tutta la banda in modo efficiente. Recentemente si è quindi introdotto un fattore di "
scaling" (
RFC 1323), cioè un'opzione che permette di aumentare la dimensione della window da 64Kbyte a 1Gbyte.
Già su un collegamento a 100Mbit/s in ethernet si vede la differenza: con window scaling disattivato si ottiene un throughput (velocità di trasferimento) di 6-7Mbytes/s, attivandolo si ottengono 11Mbytes/s. Su collegamenti con latenza più alta (ad esempio ADSL), l'effetto si nota anche a velocità inferiori.
Il window scaling è attivo di default su Linux dall'Agosto 2004 (kernel 2.6.8), nelle ultime versioni di Mac OS X e in Windows Vista.
I router e i firewall vecchi non riconoscono questa opzione e mentre inoltrano i pacchetti, riscrivono il contenuto della window, rendendo il trasferimento dati instabile, lento o addirittura bloccandolo. Questo effetto si riscontra ad esempio quando un computer si collega ad un server, entrambi supportano il window scaling, ma lungo il percorso si attraversa uno di questi apparati non aggiornati.
Scrivo e spiego tutto questo perchè di recente mi è capitata una cosa alquanto singolare. La
mia azienda ha un cliente al quale viene fornito un servizio di hosting per il suo sito web. Il contenuto del sito viene realizzato da un'agenzia di grafica, che già segue il cliente per cataloghi e altre cose.
Una persona di questa agenzia ha chiamato lamentandosi di non riuscire ad inviare dei file sul nostro server, mentre sui server di altri fornitori non ha mai riscontrato problemi. Dopo un'accurata analisi ho capito che il problema era legato al fatto che sia il suo Mac sia il nostro server supportano il window scaling, ma il loro router o qualcuno di quelli del loro ISP non gestiscono questa opzione correttamente.
Ho provato a spiegargli il problema, ma non c'è stato modo di farglielo capire, insisteva sul fatto che altri fornitori di hosting con i quali lavora non hanno problemi di questo tipo (certamente, usano server Windows, che non supportano il window scaling, oppure l'hanno disattivato, peggiorandone le prestazioni), ed è arrivato addirittura a proporre all'azienda di cambiare fornitore.
Se anche a voi capita di incorrere in queste situazioni, secondo me le cose più sagge da fare sono: disabilitare temporaneamente l'opzione di window scaling (basta cercare su google per capire come fare sul proprio sistema operativo), controllare il proprio router/firewall e aggiornarlo o sostituirlo, infine avvisare il proprio ISP (che vi da l'accesso ad internet). Se quest'ultimo non collabora, siete sempre liberi di sceglierne uno più competente.