词条 | Keepalive |
释义 |
A keepalive (KA) is a message sent by one device to another to check that the link between the two is operating, or to prevent the link from being broken. DescriptionA keepalive signal is often sent at predefined intervals, and plays an important role on the Internet. After a signal is sent, if no reply is received the link is assumed to be down and future data will be routed via another path until the link is up again. A keepalive signal can also be used to indicate to Internet infrastructure that the connection should be preserved. Without a keepalive signal, intermediate NAT-enabled routers can drop the connection after timeout. Since the only purpose is to find links that don't work or to indicate connections that should be preserved, keepalive messages tend to be short and not take much bandwidth. However, their precise format and usage terms depend on the communication protocol. TCP keepaliveTransmission Control Protocol (TCP) keepalives are an optional feature, and if included must default to off.[1] The keepalive packet contains no data. In an Ethernet network, this results in frames of minimum size (64 bytes[2]). There are three parameters[3] related to keepalive:
When two hosts are connected over a network via TCP/IP, TCP Keepalive Packets can be used to determine if the connection is still valid, and terminate it if needed. Most hosts that support TCP also support TCP Keepalive. Each host (or peer) periodically sends a TCP packet to its peer which solicits a response. If a certain number of keepalives are sent and no response (ACK) is received then the sending host will terminate the connection from its end. If a connection has been terminated due to a TCP Keepalive time-out and the other host eventually sends a packet for the old connection, the host that terminated the connection will send a packet with the RST flag set to signal the other host that the old connection is no longer active. This will force the other host to terminate its end of the connection so a new connection can be established. Typically TCP Keepalives are sent every 45 or 60 seconds on an idle TCP connection, and the connection is dropped after 3 sequential ACKs are missed. This varies by host, e.g. by default Windows PCs send the first TCP Keepalive packet after 7200000ms (2 hours), then sends 5 Keepalives at 1000ms intervals, dropping the connection if there is no response to any of the Keepalive packets. Keepalive on higher layersSince TCP keepalive is optional, various protocols (e.g. SMB[4] and TLS[5]) add a similar feature on top of it. This is also common for protocols which maintain a session over a connectionless protocol, e.g. OpenVPN over UDP.[6] Other usesHTTP keepalive{{main|HTTP persistent connection}}The Hypertext Transfer Protocol uses the keyword "Keep-Alive" in the "Connection" header to signal that the connection should be kept open for further messages (this is the default in HTTP 1.1, but in HTTP 1.0 the default was to use a new connection for each request/reply pair).[7] Despite the similar name, this function is entirely unrelated. Other devices"Keep-alive" devices are used in automotive repair to maintain battery voltage for devices in the vehicle when the battery is disconnected or changed, usually by plugging in a small battery to the vehicle's 12 volt power outlet. A typical application is preventing the vehicle's radio or other device from going to "code" mode (security lockout) during vehicle repair. Typically a lower voltage source, such as a 9–volt battery, is sufficient for the purpose. Electric clocks often have battery-powered keep-alive circuits to maintain time and other settings during a power outage. Some electronic devices use a capacitor circuit to maintain volatile memory when the user changes the battery. See also
References1. ^{{cite web|url=http://tools.ietf.org/html/rfc1122#page-101|work=IETF|title=Requirements for Internet Hosts - Communication Layers|date=October 1989|accessdate=November 8, 2013}} {{Compu-network-stub}}2. ^{{cite web | url = https://ieeexplore.ieee.org/document/7428776/ | title = 3.1.1 Packet format | work = IEEE Standard for Ethernet, 802.3-2015 – section one | year = 2016 | accessdate = 2018-10-02 | page = 108 | format = PDF | url-access = registration}} 3. ^{{Cite web|url=http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/usingkeepalive.html|title=Using TCP keepalive under Linux|website=tldp.org|access-date=2016-07-29}} 4. ^{{cite web|url=https://tools.ietf.org/html/rfc1001#page-54|work=IETF|title=Protocol Standard for a NetBIOS Service on a TCP/UDP Transport: Concepts and Methods|date=March 1987|accessdate=June 18, 2015}} 5. ^{{cite web|url=https://tools.ietf.org/html/rfc6520|work=IETF|title=Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS) Heartbeat Extension|date=February 2012|accessdate=June 18, 2015}} 6. ^{{cite web|url=https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage|title=OpenVPN manual page|accessdate=June 18, 2015}} 7. ^{{cite web |url=http://www.io.com/~maus/HttpKeepAlive.html |archiveurl=https://web.archive.org/web/20100813132504/http://www.io.com/~maus/HttpKeepAlive.html |archivedate=2010-08-13 |title=HTTP Keep Alive discourse by Jim Driscoll}} 1 : Computer networking |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。