2017年9月11日星期一

Network


 



  Network






  • 网络基本功系列:细说网络那些事儿
  • https://github.com/alex/what-happens-when#dns-lookup 浏览器如何访问google
  • Proxy Digest Authentication?
  • Why TChannel?
    • Why not HTTP? HTTP connections are uni-directional, can only be used for one concurrent request, and are built for delivering web pages with cache hints. HTTP tightly couples encoding and transport concerns (the path implies both the procedure name and sometimes even parts of the request body), having a single, header namespace with variable widths. It is not ideal for RPC, but it's fantastic for web pages.
    • HTTP2:
    • HTTP2 vs WebSocket
      • WebSocket is bidirectional; HTTP2 is client/server + server push
    • TChannel: RPC, multiplexing, bi-directional message passing, fast forwarding, work shedding with deadlines, cancellation, speculative execution, and communicates more clearly about when and when not to retry.
  • Improve Web Speed: client -> DNS resolver -> DNS -> DNS resolver -> client --req--> Web server
    • Speed = DNS latency + Request latency. Which DNS has lowest latency? Can't measure directly because of DNS resolver delegates the name resolution. Solution: create a special hostname to resolve (avoid cache), latency = server access time - special hostname resolve time

DNS resolvers


DNS客户端设置使用的DNS服务器(8.8.4.4)一般都是递归服务器,它负责全权处理客户端的DNS查询请求,直到返回最终结果。而DNS服务器之间一般采用迭代查询方式

  1. clear DNS cache sudo killall -HUP mDNSResponder
  2. check DNS client: sudo lsof -i -P | grep LISTEN
  3. http://whoismydns.com/Index.html
  4. dig @127.0.0.1 -p 53 google.com +tcp +trace





TCP

  • Connection Reset: the peer rejects it with an RST to let you know it isn't listening.
  • send() returns only means transmitted through interface

Load Balancer

课外加强阅读

GFW


没有评论:

发表评论