2013-03-18 4 views
6

Sto programmando il driver di periferica Linux su un'interfaccia molto lenta, il cui tempo di round ping può essere lungo diversi minuti. Quando provo a usare TCP per stabilire una connessione tra due nodi, la connessione scade sempre.Modifica del timeout TCP per un dispositivo di rete linux

Esiste un metodo per impostare il timeout di ritrasmissione TCP o di handshaking più lungo nel driver o ci sono comandi per impostarlo? Grazie

risposta

4

Hai provato a cercare una risposta a questa domanda? Una rapida ricerca su Google mi ha dato il numero this, che sembra affrontare direttamente questo problema. Il riepilogo è che l'impostazione di net.ipv4.tcp_syn_retries determina il timeout massimo disponibile per le connessioni TCP.

Se il documento non risponde alla domanda, è necessario indicare cosa si è tentato e in che modo il comportamento è diverso da quello previsto.

+0

+1 - semplicemente pulito :) – linski

+0

Grazie. La tua risposta aiuta davvero. Ma posso impostare un timeout diverso per le diverse interfacce? –

0
/proc/sys/net/ipv4/tcp_retries1 
/proc/sys/net/ipv4/tcp_retries2 

.

tcp_retries1 - INTEGER 


This value influences the time, after which TCP decides, that 
    something is wrong due to unacknowledged RTO retransmissions, 
    and reports this suspicion to the network layer. 
    See tcp_retries2 for more details. 

    RFC 1122 recommends at least 3 retransmissions, which is the 
    default. 


tcp_retries2 - INTEGER 

This value influences the timeout of an alive TCP connection, 
when RTO retransmissions remain unacknowledged. 
Given a value of N, a hypothetical TCP connection following 
exponential backoff with an initial RTO of TCP_RTO_MIN would 
retransmit N times before killing the connection at the (N+1)th RTO. 

The default value of 15 yields a hypothetical timeout of 924.6 
seconds and is a lower bound for the effective timeout. 
TCP will effectively time out at the first RTO which exceeds the 
hypothetical timeout. 

RFC 1122 recommends at least 100 seconds for the timeout, 
which corresponds to a value of at least 8.