百度APP移动端网络深度优化实践分享(一):DNS优化篇
<div style="color: black; text-align: left; margin-bottom: 10px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">本文由百度技术团队“蔡锐”原创<span style="color: black;">发布</span>于“百度App技术”公众号,原题为《百度App网络深度优化系列《一》DNS优化》,感谢原作者的无私分享。</p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;"><strong style="color: blue;"><span style="color: black;">1、</span>前言</strong></h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">网络优化是客户端几大技术方向中公认的一个深度<span style="color: black;">行业</span>,<span style="color: black;">因此</span>百度App给<span style="color: black;">大众</span>带来网络深度优化系列<span style="color: black;">文案</span>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">本系列<span style="color: black;">文案</span>目录如下:</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《百度APP移动端网络深度优化实践分享(一):DNS优化篇》(* 本文)</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《百度APP移动端网络深度优化实践分享(二):网络连接优化篇》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《百度APP移动端网络深度优化实践分享(三):移动端弱网优化篇》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">期盼</span>对<span style="color: black;">大众</span>在网络方向的学习和实践有所<span style="color: black;">帮忙</span>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">百度起家于搜索,<span style="color: black;">全部</span><span style="color: black;">机构</span>的网络架构和<span style="color: black;">安排</span>都是基于标准的internet协议,<span style="color: black;">日前</span><span style="color: black;">已然</span>是全栈HTTPS,来到移动互联网时代后,总的<span style="color: black;">基本</span>架构不变,但在客户端上<span style="color: black;">必须</span>做<span style="color: black;">非常多</span>优化工作。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">DNS(Domain Name System),它的<span style="color: black;">功效</span>是<span style="color: black;">按照</span>域名查出IP<span style="color: black;">位置</span>,它是HTTP协议的前提,<span style="color: black;">仅有</span>将域名正确的解析成IP<span style="color: black;">位置</span>后,后面的HTTP流程<span style="color: black;">才可</span>进行,<span style="color: black;">因此</span><span style="color: black;">通常</span>做网络优化会首选优化DNS。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">(本文同步发布于:</p>http://www.52im.net/thread-2472-1-1.html)
<h1 style="color: black; text-align: left; margin-bottom: 10px;"><strong style="color: blue;"><span style="color: black;">2、</span><span style="color: black;">关联</span><span style="color: black;">文案</span></strong></h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《TCP/IP详解 卷1:协议 - 第14章 DNS:域名系统》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《全面<span style="color: black;">认识</span>移动端DNS域名劫持等杂症:技术原理、问题根源、<span style="color: black;">处理</span><span style="color: black;">方法</span>等》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《美图App的移动端DNS优化实践:HTTPS请求耗时减小近半》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《现代移动端网络短连接的优化手段总结:请求速度、弱网适应、安全<span style="color: black;">保证</span>》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《移动端IM<span style="color: black;">研发</span>者必读(一):通俗易懂,理解移动网络的“弱”和“慢”》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《移动端IM<span style="color: black;">研发</span>者必读(二):史上最全移动弱网络优化<span style="color: black;">办法</span>总结》</p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;"><strong style="color: blue;"><span style="color: black;">3、</span>技术背景</strong></h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">DNS优化核心<span style="color: black;">必须</span><span style="color: black;">处理</span>的问题有两点:</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">1)<span style="color: black;">因为</span>DNS劫持或故障<span style="color: black;">导致</span>的服务不可用,<span style="color: black;">从而</span>影响用户体验,影响<span style="color: black;">机构</span>的收入;</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">2)<span style="color: black;">因为</span>DNS调度不准确<span style="color: black;">引起</span>的性能退化,<span style="color: black;">从而</span>影响用户体验。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">百度App承载着亿级流量,每年都会遇到运营商DNS劫持或运营商DNS故障,整体影响非常<span style="color: black;">欠好</span>,<span style="color: black;">因此</span>DNS优化刻不容缓,<span style="color: black;">经过</span>下图会更直观的<span style="color: black;">认识</span>运营商劫持或故障的原理。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/e5b8cc117b7942ffa794c3c1427e12bd~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723707171&x-signature=3nhF%2BubbtyRdqPIithPEkV3XevU%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">▲ 运营商劫持或故障的原理</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">相关</span>移动端DNS劫持等<span style="color: black;">各样</span>疑难杂症,详见文章《全面<span style="color: black;">认识</span>移动端DNS域名劫持等杂症:技术原理、问题根源、<span style="color: black;">处理</span><span style="color: black;">方法</span>等》。</p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;"><strong style="color: blue;"><span style="color: black;">4、</span>HTTPDNS</strong></h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">4.1 概述</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">既然<span style="color: black;">咱们</span>面临这么严峻的问题,<span style="color: black;">那样</span><span style="color: black;">咱们</span><span style="color: black;">怎样</span>优化DNS呢?答案<span style="color: black;">便是</span>HTTPDNS。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">大部分标准DNS都是基于UDP与DNS服务器交互的,HTTPDNS则是利用HTTP协议与DNS服务器交互,绕开了运营商的Local DNS服务,有效防止了域名劫持,<span style="color: black;">加强</span>域名解析效率,下图是HTTPDNS的原理。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/9289506de694495f856e080bd5222e43~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723707171&x-signature=V7wIlFCng6QOWoq0IekF4Cxva%2FE%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">▲ HTTPDNS原理</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">百度App HTTPDNS端上的实现是基于百度SYS团队的HTTPDNS服务,下图介绍了HTTPDNS的服务端<span style="color: black;">安排</span>结构。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/e3eed4226f17454fa0421824fbcbc22a~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723707171&x-signature=cygHSOXnUkfQVhOif%2BvtED06p20%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">▲ HTTPDNS<span style="color: black;">安排</span>结构</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">HTTPDNS服务是基于BGP接入的,BGP英文Border Gateway Protocol,即边界网关协议,是一种在自治系统之间动态的交换路由信息的路由协议,BGP<span style="color: black;">能够</span><span style="color: black;">按照</span>当前用户的运营商路由到百度服务点的对应集群上,<span style="color: black;">针对</span>第三方域名,服务点会<span style="color: black;">经过</span>百度<span style="color: black;">安排</span>在运营商的CDN节点向其他域名权威DNS发起<span style="color: black;">查找</span>,<span style="color: black;">查找</span>这个运营商下域名的最优IP。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">百度App独立实现了端的HTTPDNS SDK,下图介绍了端HTTPDNS的整体架构。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/e0d3f9e533c84bff80a9e7f18339b5ce~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723707171&x-signature=1Ghr%2BZGNmb3OiH%2FBAJMBtDeKK0g%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">▲ 端HTTPDNS的整体架构</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">更加多</span>HTTPDNS的资料,请见:《全面<span style="color: black;">认识</span>移动端DNS域名劫持等杂症:技术原理、问题根源、<span style="color: black;">处理</span><span style="color: black;">方法</span>等》、《美图App的移动端DNS优化实践:HTTPS请求耗时减小近半》。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">4.2 DNS接口层</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">DNS接口层<span style="color: black;">处理</span>的问题是屏蔽底层的细节,对外<span style="color: black;">供给</span>简单整洁的API,降低<span style="color: black;">运用</span>者的上手成本,<span style="color: black;">加强</span><span style="color: black;">研发</span>效率。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">4.3 DNS策略层</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">DNS策略层<span style="color: black;">经过</span>多种策略的组合,使HTTPDNS服务在性能,稳定性,可用性上均保持较高的水准,下面讲解下<span style="color: black;">每一个</span>策略设计的初衷和<span style="color: black;">详细</span>实现。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">【4.3.1 容灾策略】:</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">这是一个非常关键的策略,<span style="color: black;">重点</span><span style="color: black;">处理</span>HTTPDNS服务可用性的问题,实践证明,这个策略<span style="color: black;">帮忙</span>百度App在<span style="color: black;">反常</span><span style="color: black;">状况</span>下挽救回<span style="color: black;">非常多</span>流量。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">(1)</strong>当HTTPDNS服务不可用并且本地<span style="color: black;">亦</span><span style="color: black;">无</span>缓存<span style="color: black;">或</span>缓存失效的时候,会触发降级策略,降级成运营商的localDNS<span style="color: black;">方法</span>,虽然存在运营商事故<span style="color: black;">或</span>劫持的<span style="color: black;">危害</span>,但<span style="color: black;">保证</span>了DNS服务的可用性。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">(2)</strong>当HTTPDNS服务和localDNS服务双双不可用的<span style="color: black;">状况</span>下,会触发backup策略,<span style="color: black;">运用</span>端上的backup IP。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">什么是backup IP?backup IP是多组<span style="color: black;">按照</span>域名<span style="color: black;">归类</span>的IP列表,可云端动态更新,方便后续运维<span style="color: black;">朋友</span><span style="color: black;">调节</span>服务端的节点IP,不是所有域名都有对应的backup IP列表,<span style="color: black;">日前</span>百度App只能<span style="color: black;">保准</span>核心域名的可用性。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">既然是一组IP,便有<span style="color: black;">选择</span>问题,backup IP<span style="color: black;">选择</span>机制是<span style="color: black;">怎么样</span>的呢?<span style="color: black;">咱们</span>的中心思想<span style="color: black;">便是</span>要在端上利用最小的代价,并且<span style="color: black;">思虑</span>服务端的负载<span style="color: black;">平衡</span>,得到相对正确<span style="color: black;">或</span><span style="color: black;">恰当</span>的<span style="color: black;">选择</span>结果。<span style="color: black;">经过</span>运营商和地理信息,<span style="color: black;">能够</span><span style="color: black;">选取</span>一个相对较优的IP,但获取地理信息<span style="color: black;">必须</span>很大耗时,外加频次很高,代价很大,<span style="color: black;">因此</span><span style="color: black;">咱们</span><span style="color: black;">选取</span>了RR算法来代替上面的<span style="color: black;">办法</span>(RR算法是Round-Robin,轮询调度),<span style="color: black;">这般</span>客户端的代价降低到最小,服务端<span style="color: black;">亦</span>实现了负载<span style="color: black;">平衡</span>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">【4.3.2 安全策略】:</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">(1)</strong>HTTPDNS<span style="color: black;">处理</span>的核心问题<span style="color: black;">便是</span>安全,标准的DNS<span style="color: black;">查找</span>大部分是基于UDP的,但<span style="color: black;">亦</span>有基于TCP的,<span style="color: black;">倘若</span>UDP被封禁,就<span style="color: black;">必须</span><span style="color: black;">运用</span>TCP。不管是UDP还是TCP,安全性都是<span style="color: black;">无</span><span style="color: black;">保证</span>的,HTTPDNS<span style="color: black;">查找</span>是基于标准的HTTP协议,为了<span style="color: black;">保准</span>安全<span style="color: black;">咱们</span>会在HTTP上加一层TLS(安全传输层协议),这便是HTTPS;</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">(2)</strong><span style="color: black;">处理</span>了传输层协议的安全性后,<span style="color: black;">咱们</span>要<span style="color: black;">处理</span>下域名解析的问题,上面<span style="color: black;">咱们</span><span style="color: black;">说到</span>HTTPDNS服务是基于BGP接入的,在端上采用VIP方式请求HTTPDNS数据(VIP即Virtual IP,VIP并<span style="color: black;">无</span>与某设备存在必定的绑定关系,会跟随主备切换之类的<span style="color: black;">状况</span><span style="color: black;">出现</span>而变换,VIP<span style="color: black;">供给</span>的服务是对应到某一台或若干台服务器的),既然请求原始数据<span style="color: black;">必须</span><span style="color: black;">运用</span>IP直连的方式,<span style="color: black;">那样</span>就摆脱了运营商localDNS的解析限制,<span style="color: black;">这般</span>即使运营商<span style="color: black;">显现</span>了故障<span style="color: black;">或</span>被劫持,都不会影响百度App的可用性。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">【4.3.3 任务调度策略】:</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">HTTPDNS服务<span style="color: black;">供给</span>了两类HTTP接口,用于请求最优域名结果。<span style="color: black;">第1</span>种是多域名接口,针对<span style="color: black;">区别</span>的<span style="color: black;">制品</span>线,下发<span style="color: black;">制品</span>线配置的域名,第二种是单域名接口,只返回你要<span style="color: black;">查找</span>的那个域名结果,<span style="color: black;">这般</span>的设计和标准的DNS<span style="color: black;">查找</span>基本是<span style="color: black;">同样</span>的,只<span style="color: black;">不外</span>是从UDP协议变<span style="color: black;">成为了</span>HTTP协议。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">(1)</strong>多域名接口会在App冷<span style="color: black;">起步</span>和网络切换的时候请求一次,目的是在App的网络环境初始化<span style="color: black;">或</span>变化的时候预先获取域名结果,<span style="color: black;">这般</span><span style="color: black;">亦</span>会减少单域名接口的请求次数。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">(2)</strong>单域名接口会在本地cache过期后,由用户的操作触发网络请求,<span style="color: black;">从而</span>做一次单域名请求,用户这次操作的DNS结果会降级成localDNS的结果,但在<span style="color: black;">无</span>过期的<span style="color: black;">状况</span>下,下次会返回HTTPDNS的结果。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">【4.3.4 IP<span style="color: black;">选择</span>策略】:</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">IP<span style="color: black;">选择</span>策略<span style="color: black;">处理</span>的核心问题是最优IP的<span style="color: black;">选择</span>,避免<span style="color: black;">由于</span>接入点的<span style="color: black;">选择</span>错误<span style="color: black;">导致</span>的跨运营商耗时。HTTPDNS服务会将最优IP<span style="color: black;">根据</span><span style="color: black;">次序</span>下发,客户端默认<span style="color: black;">选择</span><span style="color: black;">第1</span>个,<span style="color: black;">这儿</span><span style="color: black;">无</span>做客户端的连通性校验的<span style="color: black;">原由</span>,主要还是担心端上的性能问题,<span style="color: black;">不外</span>有容灾策略兜底,综合<span style="color: black;">评定</span>还是<span style="color: black;">能够</span>接受的。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">【4.3.5 缓存策略】:</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">大众</span><span style="color: black;">针对</span>DNS缓存并不陌生,它<span style="color: black;">重点</span>是为了<span style="color: black;">提高</span><span style="color: black;">拜访</span>效率,操作系统,网络库等都会做DNS缓存。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">DNS缓存中一个重要的概念<span style="color: black;">便是</span>TTL(Time-To-Live),在localDNS中针对<span style="color: black;">区别</span>的域名,TTL的时间是不<span style="color: black;">同样</span>的,在HTTPDNS中这个值由服务端动态下发,百度App<span style="color: black;">日前</span>所有的域名TTL的配置是5分钟,过期后<span style="color: black;">倘若</span><span style="color: black;">无</span>新的IP将继续沿用老的IP,当然<span style="color: black;">亦</span><span style="color: black;">能够</span><span style="color: black;">选取</span>不沿用老的IP,而降级成localDNS的IP,<span style="color: black;">那样</span>这就取决于localDNS<span style="color: black;">针对</span>过期IP的处理。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">【4.3.6 命中率策略】:</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">倘若</span>HTTPDNS的命中率是100%,在<span style="color: black;">保准</span>HTTPDNS服务稳定<span style="color: black;">有效</span>的前提下,<span style="color: black;">咱们</span>就<span style="color: black;">能够</span>做到防劫持,<span style="color: black;">提高</span><span style="color: black;">精细</span>调度的能力。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">(1)</strong>为了<span style="color: black;">提高</span>HTTPDNS的命中率,<span style="color: black;">咱们</span><span style="color: black;">选取</span><span style="color: black;">运用</span>多域名接口,在冷<span style="color: black;">起步</span>和网络切换的时候,批量拉取域名结果并缓存在本地,便于接下来的请求<span style="color: black;">运用</span>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">(2)</strong>为了再一次<span style="color: black;">提高</span>HTTPDNS的命中率,当用户操作触发网络请求,获取域名对应的IP时,会提前进行本地过期时间判断,时间是60s,<span style="color: black;">倘若</span>过期,会发起单域名的请求并缓存起来,<span style="color: black;">这般</span>会<span style="color: black;">连续</span>延长域名结果的过期时间。本地过期时间与上面<span style="color: black;">说到</span>的TTL是客户端和服务端的双重过期时间,目的是在<span style="color: black;">反常</span><span style="color: black;">状况</span>下<span style="color: black;">能够</span>双重<span style="color: black;">保准</span>过期时间的准确性。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">4.4 <span style="color: black;">基本</span>能力层</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">基本</span>能力层<span style="color: black;">重点</span><span style="color: black;">供给</span>给DNS策略层所<span style="color: black;">必须</span>的<span style="color: black;">基本</span>能力,<span style="color: black;">包含</span>IPv4/IPv6协议栈探测的能力,数据传输的能力,缓存实现的能力,下面将讲解每种能力的<span style="color: black;">详细</span>实现。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">【4.4.1 IPv4/IPv6协议栈探测】:</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">百度App的IPv6改造正在如火如荼的进行中,端上在HTTPDNS的IP<span style="color: black;">选择</span>上<span style="color: black;">怎样</span><span style="color: black;">晓得</span><span style="color: black;">日前</span>属于哪个协议栈<span style="color: black;">作为</span>关键性问题,并且这种判断<span style="color: black;">需求</span>性能极高,<span style="color: black;">由于</span>IP<span style="color: black;">选择</span>的频次实在是太高了。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">咱们</span><span style="color: black;">选择</span>的<span style="color: black;">方法</span>是UDP Connect,<span style="color: black;">那样</span>何为UDP Connect?</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">大众</span>都<span style="color: black;">晓得</span>TCP是面向连接的,传输数据前客户端都要调用connect<span style="color: black;">办法</span><span style="color: black;">经过</span>三次握手<span style="color: black;">创立</span>连接,UDP是面向无连接的,无需<span style="color: black;">创立</span>连接便能收发数据,<span style="color: black;">然则</span><span style="color: black;">倘若</span><span style="color: black;">咱们</span>调用了UDP的connect<span style="color: black;">办法</span>会<span style="color: black;">出现</span>什么呢?当<span style="color: black;">咱们</span>调用UDP的connect<span style="color: black;">办法</span>时,系统会检测其端口<span style="color: black;">是不是</span>可用,<span style="color: black;">位置</span><span style="color: black;">是不是</span>正确,<span style="color: black;">而后</span>记录对端的IP<span style="color: black;">位置</span>和端口号,返回给调用者,<span style="color: black;">因此</span>UDP Connect不会像TCP Connect发起三次握手,<span style="color: black;">出现</span>网络真实损耗,UDP客户端<span style="color: black;">仅有</span>调用send<span style="color: black;">或</span>sendto<span style="color: black;">办法</span>后才会真正发起真实网络损耗。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/2d8bfbe74f9c4f7ab33e99b416a027f5~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723707171&x-signature=3H2F9GD1Tts5SAPJ7cFQ5A3Me7o%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">▲ UDP Connect原理</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">有了UDP Connect的<span style="color: black;">基本</span><span style="color: black;">保证</span>,<span style="color: black;">咱们</span>在上层做了缓存机制,用来减少系统调用的损耗,<span style="color: black;">机会</span>上<span style="color: black;">日前</span>仅在冷<span style="color: black;">起步</span>和网络切换会触发探测,在同一种网络制式下探测一次基本<span style="color: black;">能够</span><span style="color: black;">保证</span>当前网络是IPv4栈还是IPv6栈。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">日前</span>百度App客户端<span style="color: black;">针对</span>IPv4/IPv6双栈的策略是保守的,仅在IPv6-only的<span style="color: black;">状况</span>下<span style="color: black;">运用</span>v6的IP,其余<span style="color: black;">运用</span>的都是v4的IP,双栈下的<span style="color: black;">方法</span>后续<span style="color: black;">必须</span>优化,业内<span style="color: black;">日前</span>标准的做法是happy eyeball算法。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">什么叫happy eyeball呢?</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">便是</span>不会<span style="color: black;">由于</span>IPv4或IPv6的故障问题,<span style="color: black;">引起</span>用户的眼球<span style="color: black;">始终</span>在等待加载<span style="color: black;">或</span>出错,这<span style="color: black;">便是</span>happy eyeball名字的由来。happy eyeball有v1版本RFC6555和v2版本RFC8305,前者是Cisco提出来的,后者是苹果提出来的。happy eyeball<span style="color: black;">处理</span>的核心问题是,<span style="color: black;">繁杂</span>环境下v4和v6 IP<span style="color: black;">选择</span>的问题,它是一套整体<span style="color: black;">处理</span><span style="color: black;">方法</span>,<span style="color: black;">针对</span>域名<span style="color: black;">查找</span>的处理,<span style="color: black;">位置</span>的排序,连接的尝试等方面均做出了规定,感兴趣的<span style="color: black;">朋友</span><span style="color: black;">能够</span>查看参考资料里的【5】和【6】。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">【4.4.2 数据传输】:</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">数据传输<span style="color: black;">重点</span><span style="color: black;">供给</span>网络请求的能力和数据解析的能力。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">(1)</strong>网络请求失败重试的机制,获取HTTPDNS结果的成功率会大大影响HTTPDNS的命中率,<span style="color: black;">因此</span>客户端会有一个三次重试的机制,<span style="color: black;">保证</span>成功率。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">(2)</strong>数据解析<span style="color: black;">反常</span>的机制,<span style="color: black;">倘若</span>获取的HTTPDNS的结果存在<span style="color: black;">反常</span>,将不会覆盖端上的缓存。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">【4.4.3 缓存实现】:</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">缓存的实现基本<span style="color: black;">能够</span>分为磁盘缓存和内存缓存,<span style="color: black;">针对</span>HTTPDNS的缓存场景,<span style="color: black;">咱们</span>是选其一还是都<span style="color: black;">选取</span>呢?</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">百度App<span style="color: black;">选取</span>的是内存缓存,目的是防止<span style="color: black;">咱们</span>自己的服务<span style="color: black;">显现</span>问题,运维<span style="color: black;">朋友</span>在紧急<span style="color: black;">状况</span>下切换流量,<span style="color: black;">倘若</span>做了磁盘缓存,会<span style="color: black;">引起</span>百度App在重启后<span style="color: black;">亦</span>可能不可用,但这种问题会<span style="color: black;">引起</span>APP在冷<span style="color: black;">起步</span><span style="color: black;">时期</span>,HTTPDNS结果未返回前,还是存在故障<span style="color: black;">或</span>劫持的<span style="color: black;">危害</span>,综合<span style="color: black;">评定</span>来看<span style="color: black;">能够</span>接受,<span style="color: black;">倘若</span><span style="color: black;">显现</span>这种极端<span style="color: black;">状况</span>,影响的是冷<span style="color: black;">起步</span><span style="color: black;">周期</span>的<span style="color: black;">有些</span>请求,但只要HTTPDNS结果返回后便会恢复正常。</p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;"><strong style="color: blue;"><span style="color: black;">5、</span>HTTPDNS的最佳实践</strong></h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">百度App<span style="color: black;">日前</span>客户端网络架构<span style="color: black;">因为</span>历史<span style="color: black;">原由</span>还未统一,<span style="color: black;">不外</span><span style="color: black;">咱们</span>正朝着这个<span style="color: black;">目的</span><span style="color: black;">奋斗</span>,下面着重介绍下HTTPDNS在Android和iOS网络架构中的位置及实践。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">HTTPDNS在Android网络架构的位置及实践:</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">百度App的Android网络流量都在okhttp之上,上层进行了网络门面的封装,封装内部的实现细节和对外友好的API,供各个业务和<span style="color: black;">基本</span>模块<span style="color: black;">运用</span>,在okhttp上<span style="color: black;">咱们</span>扩展了DNS模块,<span style="color: black;">运用</span>HTTPDNS替换了原有的系统DNS。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/5b8b19c8ec8a458abbefee65abc2083f~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723707171&x-signature=uDLMozeI3snrhqswbheLO7ei1cs%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">▲ HTTPDNS在Android网络架构的位置</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">HTTPDNS在iOS网络架构的位置及实践:</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">百度App的iOS网络流量都在cronet(chromium的net模块)之上,上层<span style="color: black;">咱们</span><span style="color: black;">运用</span>AOP的方式将cronet stack注入进URLSession里,<span style="color: black;">这般</span><span style="color: black;">咱们</span>就<span style="color: black;">能够</span>直接<span style="color: black;">运用</span>URLSession的API进行网络的操作<span style="color: black;">况且</span>更易于系统<span style="color: black;">守护</span>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">在上层封装了网络门面,供各个业务和<span style="color: black;">基本</span>模块<span style="color: black;">运用</span>,在cronet内部<span style="color: black;">咱们</span>修改了DNS模块,除了原有的系统DNS<span style="color: black;">规律</span>外,还添加了HTTPDNS的<span style="color: black;">规律</span>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">iOS上还有一部分流量是在原生URLSession上,<span style="color: black;">重点</span>是有些第三方业务<span style="color: black;">无</span><span style="color: black;">运用</span>cronet但还想单独<span style="color: black;">运用</span>HTTPDNS的能力,<span style="color: black;">因此</span>就有了下面的HTTPDNS封装层,<span style="color: black;">办法</span>是在上层直接将域名替换成IP,域名<span style="color: black;">针对</span>底层<span style="color: black;">非常多</span>机制是至关重要的,<span style="color: black;">例如</span>https校验,cookie,重定向,SNI(Server Name Indication)等,<span style="color: black;">因此</span>将域名修改<span style="color: black;">成为了</span>IP直连后,<span style="color: black;">咱们</span>又处理了以上三种<span style="color: black;">状况</span>,<span style="color: black;">保准</span>请求的可用性。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/34c0e5e0155245d08d181f865ff55634~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1723707171&x-signature=3hlhbwSA136uxfUTrGQ9srZLylo%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">▲ HTTPDNS在iOS网络架构的位置</p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;"><strong style="color: blue;"><span style="color: black;">6、</span><span style="color: black;">实质</span>收益</strong></h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">DNS优化的收益<span style="color: black;">重点</span>有两点:</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">1)防止DNS的劫持(在出问题时<span style="color: black;">显出</span>尤为重要);</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">2)降低网络时延(在调度不准确的<span style="color: black;">状况</span>下,会增大网络的时延,降低用户的体验)。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">这两点收益<span style="color: black;">必须</span>结合业务<span style="color: black;">来讲</span>,以百度App Feed业务为例:</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">1)<span style="color: black;">第1</span>点上<span style="color: black;">咱们</span>取得了比<span style="color: black;">很强</span>的效果,iOS劫持率由0.12%降低到0.0002%,Android劫持率由0.25%降低到0.05%;</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">2)第二点的收益不<span style="color: black;">显著</span>,<span style="color: black;">原由</span>在于Feed业务<span style="color: black;">重点</span><span style="color: black;">目的</span>群体在国内,百度在国内节点布局相对丰富,服务整体质量<span style="color: black;">亦</span>较高,即使<span style="color: black;">显现</span>调度不准确的<span style="color: black;">状况</span>,差值<span style="color: black;">亦</span>不会太大,但<span style="color: black;">倘若</span>在国外<span style="color: black;">状况</span>可能会差<span style="color: black;">非常多</span>。</p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;"><strong style="color: blue;"><span style="color: black;">7、</span>本文结语</strong></h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">DNS优化是个<span style="color: black;">连续</span>性的<span style="color: black;">专题</span>,上面介绍的百度App的<span style="color: black;">有些</span>经验和做法并不见得完美,但<span style="color: black;">咱们</span>会<span style="color: black;">连续</span>深入的优化下去,为百度App的DNS能力保驾护航。最后感谢<span style="color: black;">大众</span>的辛苦阅读,<span style="color: black;">期盼</span>对你有所<span style="color: black;">帮忙</span>,后面会继续推出《百度APP移动端网络深度优化实践分享(二):网络连接优化篇》,敬请期待。</p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;"><strong style="color: blue;"><span style="color: black;">8、</span>个人心得</strong></h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">做为一个工程师,<span style="color: black;">怎样</span><span style="color: black;">才可</span>做好网络优化这件事情,是个值得<span style="color: black;">咱们</span>交流探讨的<span style="color: black;">专题</span>,个人认为应该从以下五方面入手。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">1)<span style="color: black;">基本</span>知识要<span style="color: black;">认识</span>学习,要夯实:</strong>网络<span style="color: black;">关联</span>的内容<span style="color: black;">非常多</span>,很杂,<span style="color: black;">很难</span>学习,啃过IETF发布的RFC的<span style="color: black;">朋友</span>应该深有感触。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">2)学会将看不见的网络变成看得见的:</strong><span style="color: black;">非常多</span>自认为<span style="color: black;">针对</span>网络很<span style="color: black;">认识</span>的<span style="color: black;">朋友</span>,动不动就背诵tcp协议原理,拥塞<span style="color: black;">掌控</span>算法,滑动窗口<span style="color: black;">体积</span>等,但真正遇到线上问题,无从下手。<span style="color: black;">针对</span>客户端<span style="color: black;">朋友</span>,<span style="color: black;">咱们</span>在PC上要学会<span style="color: black;">运用</span>tcpdump和Wireshark等工具,适当<span style="color: black;">运用</span>Fiddler和Charles等工具,<span style="color: black;">非常多</span>时候电脑和手机的网络环境不见得一致,<span style="color: black;">因此</span>要在手机上<span style="color: black;">运用</span>iNetTools,Ping&DNS或终端工具。学会<span style="color: black;">运用</span>工具后,要学着创造<span style="color: black;">区别</span>的网络环境,有<span style="color: black;">非常多</span>工具能<span style="color: black;">帮忙</span>你完成这点,<span style="color: black;">例如</span>苹果的Network Link Conditioner,FaceBook的ATC(Augmented Traffic Control)等。具备以上两个场景后,你的<span style="color: black;">第1</span>条<span style="color: black;">贮存</span>就发挥了<span style="color: black;">功效</span>,你要能看懂握手过程,传输过程,<span style="color: black;">反常</span>断开过程等。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">3)</strong>有了以上两点的准备,接下来<span style="color: black;">必须</span>一个会<span style="color: black;">显现</span><span style="color: black;">各样</span>网络问题的平台,给你<span style="color: black;">累积</span>经验,让一个个高压下的线上问题锤炼你,<span style="color: black;">熬煎</span>你。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">4)网络优化是<span style="color: black;">必须</span>数据支撑的:</strong>但数据的采集和分析是<span style="color: black;">必须</span>经验的,有些数据一眼看下去<span style="color: black;">便是</span>不<span style="color: black;">可靠</span>的,有些数据怎么分析都是负向收益的,<span style="color: black;">通常</span><span style="color: black;">来讲</span>是有三重奏来对数据进行分析的,一,线下数据的采集和分析,得出正向收益,二,灰度数据的采集和分析,得出正向收益,三,线上数据的采集和分析,得出正向收益。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">5)</strong>数据的正向收益,<span style="color: black;">不可</span>完全证明<span style="color: black;">提高</span>了用户的体验,<span style="color: black;">因此</span><span style="color: black;">非常多</span>时候<span style="color: black;">必须</span>针对特定场景,特定case来分析和优化,就算是<span style="color: black;">大众</span>公认做的很好的<span style="color: black;">微X</span>,<span style="color: black;">亦</span>不是在所有场景下都能<span style="color: black;">保准</span>体验上的最佳。</p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;"><strong style="color: blue;"><span style="color: black;">9、</span>参考资料</strong></h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"> https://chromium.googlesource.com/chromium/src/+/HEAD/docs/android_build_instructions.md</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"> https://chromium.googlesource.com/chromium/src/+/HEAD/docs/ios/build_instructions.md</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"> https://github.com/Tencent/mars</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"> https://tools.ietf.org/html/rfc7858</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"> https://tools.ietf.org/html/rfc6555</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"> https://tools.ietf.org/html/rfc8305</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">(原文链接:点此进入)</p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;"><strong style="color: blue;">附录:<span style="color: black;">更加多</span>网络通信方面的精华<span style="color: black;">文案</span></strong></h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《TCP/IP详解 - 第11章·UDP:用户数据报协议》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《TCP/IP详解 - 第17章·TCP:传输<span style="color: black;">掌控</span>协议》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《TCP/IP详解 - 第18章·TCP连接的<span style="color: black;">创立</span>与终止》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《TCP/IP详解 - 第21章·TCP的超时与重传》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《技术往事:改变世界的TCP/IP协议(<span style="color: black;">宝贵</span>多图、手机慎点)》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《通俗易懂-深入理解TCP协议(上):理论<span style="color: black;">基本</span>》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《通俗易懂-深入理解TCP协议(下):RTT、滑动窗口、拥塞处理》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《理论经典:TCP协议的3次握手与4次挥手过程详解》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《理论联系<span style="color: black;">实质</span>:Wireshark抓包分析TCP 3次握手、4次挥手过程》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《计算机网络通讯协议关系图(中文珍藏版)》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《UDP中一个包的<span style="color: black;">体积</span>最大能多大?》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《P2P技术详解(一):NAT详解——<span style="color: black;">仔细</span>原理、P2P简介》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《P2P技术详解(二):P2P中的NAT穿越(打洞)<span style="color: black;">方法</span>详解》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《P2P技术详解(三):P2P技术之STUN、TURN、ICE详解》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《通俗易懂:快速理解P2P技术中的NAT穿透原理》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《高性能网络编程(一):单台服务器并发TCP连接数到底<span style="color: black;">能够</span>有多少》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《高性能网络编程(二):上一个10年,著名的C10K并发连接问题》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《高性能网络编程(三):下一个10年,是时候<span style="color: black;">思虑</span>C10M并发问题了》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《高性能网络编程(四):从C10K到C10M高性能网络应用的理论探索》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《高性能网络编程(五):一文读懂高性能网络编程中的I/O模型》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《高性能网络编程(六):一文读懂高性能网络编程中的线程模型》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《不为人知的网络编程(一):浅析TCP协议中的疑难杂症(上篇)》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《不为人知的网络编程(二):浅析TCP协议中的疑难杂症(下篇)》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《不为人知的网络编程(三):关闭TCP连接时<span style="color: black;">为何</span>会TIME_WAIT、CLOSE_WAIT》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《不为人知的网络编程(四):深入<span style="color: black;">科研</span>分析TCP的<span style="color: black;">反常</span>关闭》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《不为人知的网络编程(五):UDP的连接性和负载<span style="color: black;">平衡</span>》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《不为人知的网络编程(六):深入地理解UDP协议并用好它》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《不为人知的网络编程(七):<span style="color: black;">怎样</span>让不<span style="color: black;">靠谱</span>的UDP变的<span style="color: black;">靠谱</span>?》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《不为人知的网络编程(八):从数据传输层深度解密HTTP》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《网络编程懒人入门(一):快速理解网络通信协议(上篇)》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《网络编程懒人入门(二):快速理解网络通信协议(下篇)》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《网络编程懒人入门(三):快速理解TCP协议一篇就够》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《网络编程懒人入门(四):快速理解TCP和UDP的差异》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《网络编程懒人入门(五):快速理解<span style="color: black;">为何</span>说UDP有时比TCP更有<span style="color: black;">优良</span>》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《网络编程懒人入门(六):史上最通俗的集线器、交换机、路由器功能原理入门》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《网络编程懒人入门(七):深入浅出,全面理解HTTP协议》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《网络编程懒人入门(八):手把手教你写基于TCP的Socket长连接》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《网络编程懒人入门(九):通俗讲解,有了IP<span style="color: black;">位置</span>,<span style="color: black;">为么</span>还要用MAC<span style="color: black;">位置</span>?》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《技术扫盲:新一代基于UDP的低延时网络传输层协议——QUIC详解》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《让互联网更快:新一代QUIC协议在腾讯的技术实践分享》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《现代移动端网络短连接的优化手段总结:请求速度、弱网适应、安全<span style="color: black;">保证</span>》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《聊聊iOS中网络编程长连接的<span style="color: black;">哪些</span>事》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《移动端IM<span style="color: black;">研发</span>者必读(一):通俗易懂,理解移动网络的“弱”和“慢”》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《移动端IM<span style="color: black;">研发</span>者必读(二):史上最全移动弱网络优化<span style="color: black;">办法</span>总结》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《IPv6技术详解:基本概念、应用<span style="color: black;">状况</span>、技术实践(上篇)》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《IPv6技术详解:基本概念、应用<span style="color: black;">状况</span>、技术实践(下篇)》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《从HTTP/0.9到HTTP/2:一文读懂HTTP协议的历史演变和设计思路》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《脑残式网络编程入门(一):跟着动画来学TCP三次握手和四次挥手》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《脑残式网络编程入门(二):<span style="color: black;">咱们</span>在读写Socket时,<span style="color: black;">到底</span>在读写什么?》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《脑残式网络编程入门(三):HTTP协议必知必会的<span style="color: black;">有些</span>知识》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《脑残式网络编程入门(四):快速理解HTTP/2的服务器推送(Server Push)》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《脑残式网络编程入门(五):<span style="color: black;">每日</span>都在用的Ping命令,它到底是什么?》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《脑残式网络编程入门(六):什么是公网IP和内网IP?NAT转换又是什么鬼?》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《以网游服务端的网络接入层设计为例,理解实时通信的技术挑战》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《迈向高阶:优秀Android程序员必知必会的网络基础》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《全面<span style="color: black;">认识</span>移动端DNS域名劫持等杂症:技术原理、问题根源、<span style="color: black;">处理</span><span style="color: black;">方法</span>等》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《美图App的移动端DNS优化实践:HTTPS请求耗时减小近半》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《Android程序员必知必会的网络通信传输层协议——UDP和TCP》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《IM<span style="color: black;">研发</span>者的零<span style="color: black;">基本</span>通信技术入门(一):通信交换技术的百年发展史(上)》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《IM<span style="color: black;">研发</span>者的零<span style="color: black;">基本</span>通信技术入门(二):通信交换技术的百年发展史(下)》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《IM<span style="color: black;">研发</span>者的零<span style="color: black;">基本</span>通信技术入门(三):国人通信方式的百年变迁》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《IM<span style="color: black;">研发</span>者的零<span style="color: black;">基本</span>通信技术入门(四):手机的演进,史上最全移动终端发展史》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《IM<span style="color: black;">研发</span>者的零<span style="color: black;">基本</span>通信技术入门(五):1G到5G,30年移动通信技术演进史》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《IM<span style="color: black;">研发</span>者的零<span style="color: black;">基本</span>通信技术入门(六):移动终端的接头人——“基站”技术》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《IM<span style="color: black;">研发</span>者的零<span style="color: black;">基本</span>通信技术入门(七):移动终端的千里马——“电磁波”》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《IM<span style="color: black;">研发</span>者的零<span style="color: black;">基本</span>通信技术入门(八):零<span style="color: black;">基本</span>,史上最强“天线”原理扫盲》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《IM<span style="color: black;">研发</span>者的零<span style="color: black;">基本</span>通信技术入门(九):无线通信网络的中枢——“核心网”》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《IM<span style="color: black;">研发</span>者的零<span style="color: black;">基本</span>通信技术入门(十):零<span style="color: black;">基本</span>,史上最强5G技术扫盲》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《IM<span style="color: black;">研发</span>者的零<span style="color: black;">基本</span>通信技术入门(十一):<span style="color: black;">为何</span>WiFi信号差?一文即懂!》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《IM<span style="color: black;">研发</span>者的零<span style="color: black;">基本</span>通信技术入门(十二):上网卡顿?网络掉线?一文即懂!》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《IM<span style="color: black;">研发</span>者的零<span style="color: black;">基本</span>通信技术入门(十三):<span style="color: black;">为何</span>手机信号差?一文即懂!》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《IM<span style="color: black;">研发</span>者的零<span style="color: black;">基本</span>通信技术入门(十四):高铁上无线上网有多难?一文即懂!》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《IM<span style="color: black;">研发</span>者的零<span style="color: black;">基本</span>通信技术入门(十五):理解定位技术,一篇就够》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《百度APP移动端网络深度优化实践分享(一):DNS优化篇》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">《百度APP移动端网络深度优化实践分享(二):网络连接优化篇》</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>> <span style="color: black;">更加多</span>同类<span style="color: black;">文案</span> ……</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">(本文同步发布于:</p>http://www.52im.net/thread-2472-1-1.html)
</div>
你字句如珍珠,我珍藏这份情。 这夸赞甜到心里,让我感觉温暖无比。 “沙发”(SF,第一个回帖的人)
页:
[1]