https://en.wikipedia.org/wiki/Keepalive

Description

A 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 links 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 keepalive

Transmission Control Protocol (TCP) keepalives are an optional feature, and if included must default to off.[1]

The keepalive packet contains null data.

In an Ethernet network, a keepalive frame length is 60 bytes, while the server response to this, also a null data frame, is 54 bytes.[citation needed]

There are three parameters related to keepalive:

    • Keepalive time is the duration between two keepalive transmissions in idle空闲 condition状态. TCP keepalive period is required to be configurable and by default is set to no less than 2 hours.
    • Keepalive interval is the duration between two successive keepalive retransmissions, if acknowledgement to the previous keepalive transmission is not received.
    • Keepalive retry is the number of retransmissions to be carried out before declaring that remote end is not available.

Keepalive on higher layers

Since TCP keepalive is optional, various protocols (e.g. SMB[2] and TLS[3]) 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

Keepalive的更多相关文章

  1. keepalive的不足,如何处理

    MySQL(或者其它服务)的keepalived高可用监控脚本 开发脚本需求:我们知道,keepalive是基于虚拟ip的存活来判断是否抢占master的机制的,但是如果我们做了MySQL的keepa ...

  2. 大话keepalive

    大话keepalive 我们说到keepalive的时候,需要先明确一点,这个keepalive说的是tcp的还是http的. tcp的keepalive是侧重在保持客户端和服务端的连接,一方会不定期 ...

  3. HttpsURLConnection 利用keepAlive特性进行优化一例

    最近项目中,遇到一个报错: java.lang.OutOfMemoryError: unable to create new native thread 报错的场景是:一个消息的群发,群里总共有50多 ...

  4. 修改socket为keepAlive

    参考文章:http://blog.csdn.net/ctthuangcheng/article/details/8596818 [root@mdw- gpadmin]# vi /etc/sysctl. ...

  5. HTTP Keep-Alive模式

    1.什么是Keep-Alive模式? 我们知道HTTP协议采用"请求-应答"模式, 当使用普通模式,即非KeepAlive模式时,每个请求/应答客户和服务器都要新建一个连接,完成 ...

  6. TCP心跳 | TCP keepAlive(转)

    应用层对于每个socket采用如下函数来开启 keepalive机制,其参数将采用系统上述配置. setsockopt(rs, SOL_SOCKET, SO_KEEPALIVE, (void *)&a ...

  7. 闲说HeartBeat心跳包和TCP协议的KeepAlive机制

    很多应用层协议都有HeartBeat机制,通常是客户端每隔一小段时间向服务器发送一个数据包,通知服务器自己仍然在线,并传输一些可能必要的数据.使用心跳包的典型协议是IM,比如QQ/MSN/飞信等协议. ...

  8. SCRIPT7002: XMLHttpRequest: 网络错误 0x2ef3, 由于出现错误 00002ef3 而导致此项操作无法完成,浏览器中的Keep-Alive

    http://www.cnblogs.com/OpenCoder/p/5089258.html     IE中Keep-Alive机制引起的错误 我们知道Http协议是基于TCP/IP连接的,也就是说 ...

  9. Keepalive双主搭建配置

    Keepalive 双主搭建配置 keepalived保证双主数据库的可用性 环境说明 192.168.1.10  keepalive 主1 192.168.1.20  keepalive 主2 19 ...

  10. Keep-Alive 总结

    一.简介 Keep-Alive是http请求头信息中的一个配置参数,开启之后俗称保持HTTP长连接,HTTP 1.0和HTTP 1.1都支持,HTTP1.0中该属性默认是关闭的,可在头信息中配置开启( ...

随机推荐

  1. OpenGL中两种计算投影矩阵的函数

    OpenGL无意间同时看到两种创建投影矩阵的写法,可以说它们完成的是同样的功能,但写法完全不同,可以观摩一下什么叫做异曲同工之妙... 第一种: gltMakeShadowMatrix函数是重点 // ...

  2. 【海岛帝国系列赛】No.1 海岛帝国:诞辰之日

     50111117海岛帝国:诞辰之日 [试题描述] YSF自从上次“被盗投降”完(带着一大堆债)回去以后,YSF对“海盗”怀念至今,他想要建立一个“药师傅”海岛帝国. 今天,他要像“管理部”那样去探寻 ...

  3. Spring之AOP面向切片

       一.理论基础: AOP(Aspectoriented programming)面向切片/服务的编程,在Spring中使用最多的是对事物的处理.而AOP这种思想在程序中很多地方可以使用的,比如说, ...

  4. Mongodb 笔记07 分片、配置分片、选择片键、分片管理

    分片 1. 分片(sharding)是指将数据拆分,将其分散存放在不同的机器上的过程.有时也用分区(partitioning)来表示这个概念.将数据分散到不同的机器上,不需要功能强大的大型计算机就可以 ...

  5. sql如何将同个字段不同值打印在一行

    group_concat(distinct(img)) group by id通过id分组把img的值打印在一行group_concat()通常和group by一起使用,功能是把某个字段的值打印在一 ...

  6. Mac下好用的取色器 Sip

    总有很多东西,你只是望一眼就已经神魂颠倒.措施有这样的App做的真的是用心的很,养眼,触发你内心冲动的美感.先留下一个,备忘. 太精致了 操作简单,左上角的有心圆点击就可以在任何地方取色了,取色点会z ...

  7. sql server 关联更新

    update a set a.name1 = b.name1, a.name2=b.name2from 表A a, 表B b where a.id=b.id

  8. 树形结构的数据库表Schema设计

    今天又有幸遇到一个不知道的东西,那就是树型结构在数据库表中设计的问题.由于只是阅读了人家的东西,就直接给连接吧. 第一个:http://blog.csdn.net/monkey_d_meng/arti ...

  9. 如何调动员工的积极性 -引用LTP.Net知识库

    也许是老板的意识不强,也许员工的意识薄弱,关于老板的意识强不强,我们只能看他是只顾眼前的利益,还是放眼于未来呢. 1:有一个领导的样子现在,在我国,聊天是非常时髦的,也非常受我们这个年龄段的人欢迎.如 ...

  10. easyui的页面等待提示层,即mask

    /* * 使用方法: * 开启:MaskUtil.mask(); * 关闭:MaskUtil.unmask(); * * MaskUtil.mask('其它提示文字...'); */ var Mask ...