linux-ppp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PPP Timeout
@ 2004-11-11 16:03 Rana, Gaurav (STP)
  2004-11-11 16:09 ` carlsonj
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Rana, Gaurav (STP) @ 2004-11-11 16:03 UTC (permalink / raw)
  To: linux-ppp

I have a question about the PPPD timeout.

I am using PPPD 2.4.2 on Linux (embedded system)

I successfully establish a connection with a ISP, get an IP address, and then for testing purposes I plug out the modem wire. Subsequently, any application writing (I use write() ) to the pppd socket just hangs and then after 15 minutes or so write() returns with an error. Is there anyway I could reduce this timeout to 5 minutes or so?

Thanks,
Gaurav


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PPP Timeout
  2004-11-11 16:03 PPP Timeout Rana, Gaurav (STP)
@ 2004-11-11 16:09 ` carlsonj
  2004-11-11 16:14 ` Miguel-Munoz
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: carlsonj @ 2004-11-11 16:09 UTC (permalink / raw)
  To: linux-ppp

Rana, Gaurav (STP) writes:
> I have a question about the PPPD timeout.
> 
> I am using PPPD 2.4.2 on Linux (embedded system)
> 
> I successfully establish a connection with a ISP, get an IP address, and then for testing purposes I plug out the modem wire. Subsequently, any application writing (I use write() ) to the pppd socket just hangs and then after 15 minutes or so write() returns with an error. Is there anyway I could reduce this timeout to 5 minutes or so?


Use alarm() or similar functions to set up your own timer.

This isn't a PPP (or pppd) issue at all.  This is a standard TCP/IP
mechanism.  Rather than failing right away, TCP/IP is intentionally
designed to retry for a while before just giving up.  That's because
links and routers and the network in general are not assumed to be
perfectly reliably, and that a link that has gone away may come back
or be replaced with an alternate path.

If you don't like that behavior for some reason, then you need to set
up your own timers and determine what you believe to be a "reasonable"
amount of time to wait for the response.  Beware; you're skating on
thin ice here: if you make the timer too short, then some users won't
be able to use your application on slow or congested networks.

-- 
James Carlson                                 <carlsonj@workingcode.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: PPP Timeout
  2004-11-11 16:03 PPP Timeout Rana, Gaurav (STP)
  2004-11-11 16:09 ` carlsonj
@ 2004-11-11 16:14 ` Miguel-Munoz
  2004-11-11 16:16 ` Gilles Espinasse
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Miguel-Munoz @ 2004-11-11 16:14 UTC (permalink / raw)
  To: linux-ppp

I think (you sould test it) that when this occurs, the program receives
a signal, I think a SIGPIPE (the pipe is broken).
You could use that signal to close de socket and return from the loop.

I hope it?ll work

-----Mensaje original-----
De: linux-ppp-owner@vger.kernel.org
[mailto:linux-ppp-owner@vger.kernel.org]En nombre de Rana, Gaurav (STP)
Enviado el: jueves, 11 de noviembre de 2004 17:04
Para: PPP mailing list
Asunto: PPP Timeout


I have a question about the PPPD timeout.

I am using PPPD 2.4.2 on Linux (embedded system)

I successfully establish a connection with a ISP, get an IP address, and
then for testing purposes I plug out the modem wire. Subsequently, any
application writing (I use write() ) to the pppd socket just hangs and then
after 15 minutes or so write() returns with an error. Is there anyway I
could reduce this timeout to 5 minutes or so?

Thanks,
Gaurav

-
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PPP Timeout
  2004-11-11 16:03 PPP Timeout Rana, Gaurav (STP)
  2004-11-11 16:09 ` carlsonj
  2004-11-11 16:14 ` Miguel-Munoz
@ 2004-11-11 16:16 ` Gilles Espinasse
  2004-11-11 16:18 ` Rana, Gaurav (STP)
  2004-11-11 19:55 ` carlsonj
  4 siblings, 0 replies; 6+ messages in thread
From: Gilles Espinasse @ 2004-11-11 16:16 UTC (permalink / raw)
  To: linux-ppp


----- Original Message ----- 
From: "Rana, Gaurav (STP)" <Gaurav.Rana@guidant.com>
To: "PPP mailing list" <linux-ppp@vger.kernel.org>
Sent: Thursday, November 11, 2004 5:03 PM
Subject: PPP Timeout


> I have a question about the PPPD timeout.
>
> I am using PPPD 2.4.2 on Linux (embedded system)
>
> I successfully establish a connection with a ISP, get an IP address, and
then for testing purposes I plug out the modem wire. Subsequently, any
application writing (I use write() ) to the pppd socket just hangs and then
after 15 minutes or so write() returns with an error. Is there anyway I
could reduce this timeout to 5 minutes or so?
>
> Thanks,
> Gaurav
>
Using
lcp-echo-interval 20
lcp-echo-failure 3
give a timeout after 20*3s


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: PPP Timeout
  2004-11-11 16:03 PPP Timeout Rana, Gaurav (STP)
                   ` (2 preceding siblings ...)
  2004-11-11 16:16 ` Gilles Espinasse
@ 2004-11-11 16:18 ` Rana, Gaurav (STP)
  2004-11-11 19:55 ` carlsonj
  4 siblings, 0 replies; 6+ messages in thread
From: Rana, Gaurav (STP) @ 2004-11-11 16:18 UTC (permalink / raw)
  To: linux-ppp

You mean the PIPE between the PPPD and the Application will break when the Wire is pulled out?




-----Original Message-----
From: Miguel-Munoz [mailto:miguelmunoz@sepsa.es]
Sent: Thursday, November 11, 2004 10:15 AM
To: Rana, Gaurav (STP); PPP mailing list
Subject: RE: PPP Timeout 


I think (you sould test it) that when this occurs, the program receives
a signal, I think a SIGPIPE (the pipe is broken).
You could use that signal to close de socket and return from the loop.

I hope it?ll work

-----Mensaje original-----
De: linux-ppp-owner@vger.kernel.org
[mailto:linux-ppp-owner@vger.kernel.org]En nombre de Rana, Gaurav (STP)
Enviado el: jueves, 11 de noviembre de 2004 17:04
Para: PPP mailing list
Asunto: PPP Timeout


I have a question about the PPPD timeout.

I am using PPPD 2.4.2 on Linux (embedded system)

I successfully establish a connection with a ISP, get an IP address, and
then for testing purposes I plug out the modem wire. Subsequently, any
application writing (I use write() ) to the pppd socket just hangs and then
after 15 minutes or so write() returns with an error. Is there anyway I
could reduce this timeout to 5 minutes or so?

Thanks,
Gaurav

-
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: PPP Timeout
  2004-11-11 16:03 PPP Timeout Rana, Gaurav (STP)
                   ` (3 preceding siblings ...)
  2004-11-11 16:18 ` Rana, Gaurav (STP)
@ 2004-11-11 19:55 ` carlsonj
  4 siblings, 0 replies; 6+ messages in thread
From: carlsonj @ 2004-11-11 19:55 UTC (permalink / raw)
  To: linux-ppp

Rana, Gaurav (STP) writes:
> You mean the PIPE between the PPPD and the Application will break when the Wire is pulled out?

There is no "pipe" between pppd and the application.

pppd establishes an IP interface.  IP is connectionless.  Networking
applications use transport layer protocols over IP (such as TCP) to
establish connections.

There's just no relationship between these two things.  The
connections known to the applications exist in the transport layer and
IP knows nothing of them.  The interfaces (such as PPP) are known to
IP, but have nothing to do with transports.

When the wire gets pulled out, the PPP link may eventually go down,
either quickly (due to hardware detection of loss of carrier) or
slowly (due to LCP echo timeout).  Whether it does or does not go down
doesn't matter to the application.  The application will get an error
only when the transport layer gives up trying to retransmit data to
the peer.

Again, this isn't a PPP issue.  Consider for instance what happens if
some intermediate router between your application and the remote end
of the connection goes down.  There is simply no way at all for you to
know that this has happened, except that packets start getting
dropped.  There's no mechanism that would allow you to detect this.

Given that there are undetectable cases like that, and you must deal
with them via timeouts, and that IP intentionally tries to route
around failures and the transports are patient in trying to work in
the face of transient errors, what's the point in trying to detect
local failures?

All that said, you can put a script in /etc/ppp/ip-down and use that
to kill off your applications when the link goes down, just like a
misdesigned 'doze box.  I wouldn't recommend it, though.

-- 
James Carlson                                 <carlsonj@workingcode.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-11-11 19:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-11 16:03 PPP Timeout Rana, Gaurav (STP)
2004-11-11 16:09 ` carlsonj
2004-11-11 16:14 ` Miguel-Munoz
2004-11-11 16:16 ` Gilles Espinasse
2004-11-11 16:18 ` Rana, Gaurav (STP)
2004-11-11 19:55 ` carlsonj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).