使用 HttpWatch 分析 HTTP 协议一例


首先下载破解版的 HttpWatch ,安装之后。按照手册中的说明,从IE中启动 HttpWatch ,点击 Record 按钮开始记录,然后在IE中输入 www.chinaunix.net 回车。我们就可以看到HTTP的实际运行的情况。

1.Overview 选项卡 (给出了基本情况)

  1. Overview
  2. URL:           http://www.chinaunix.net/
  3. Result:        200
  4. ====================================================================================
  5. Action         Decription
  6. ====================================================================================
  7. Display URL    Normal browser lookup of URL http://www.chinaunix.net/    Completed
  8. Started At    2012-Feb-14 10:08:08.781 (local time)                     Completed
  9. DNS Lookup    Lookup of hostname 'www.chinaunix.net'                    Completed
  10. Connect      Connect to IP address '219.148.35.60'                     Completed
  11. HTTP Request  Unconditional request sent for http://www.chinaunix.net/  Completed
  12. HTTP Response  Headers and content returned                              Completed

2.TimeChart 选项卡 (给出了HTTP各个阶段所用的时间)

  1. Time Chart
  2. ====================================================================================
  3. Timing         Started    Duration
  4. ====================================================================================
  5. Blocked+ 0.000    0.003
  6. DNS Lookup    + 0.003    0.026
  7. Connect+ 0.029    0.003
  8. Send+ 0.032    < 0.001
  9. Wait+ 0.032    0.087
  10. Receive+ 0.119    0.002
  11. TTFB+ 0.003    0.116
  12. Network+ 0.003    0.118

1)TheBlockedtime includes any pre-processing time(such ascache lookup) and the time spent waiting for a network connection to become available. Internet Explorer will only create a maximum of two concurrent network connections per host name (i.e. www.microsoft.com) and will queue up requests until a network connection is available. Often the Blocked time is the most significant factor in the download time of images embedded in a web page.

阻塞时间括所有的过程之前的时间(像,cache对比)和等待网络链接的时间,IE在每个主机名(像www.microsoft.com)下最多只创建两个当前的网络连接,而且要排队等待直到这个网络链接可用,通常,闭塞时间影响网页中图片加载时间的重要因素。

2)DNS Lookupis the time required toresolve a host name(e.g. www.google.com) into a numeric IP address (e.g. 216.239.59.99).

域名解析:针对于DNS的解析只做一次解析

3)Connectis the time required tocreate a TCP connection to the web server(or proxy). If a secure HTTPS connection is being used this time includes the SSL handshake process.Keep-Alive connections are often used to avoid the overhead of repeatedly connecting to the web server.

连接时间:是创建TCP连接到服务器或者代理服务器所花费的时间,如果一个包含SSL的安全的HTTPS连接存在,Keep-Alive链接经常被用到,以避免多次重复的连接WEB服务器。

4)Sendis the time required to send the HTTP request message to the server and will depend on the amount of data that is sent to the server. For example, long Send times will result from uploading files using an HTTP POST

发送时间:是发送HTTP请求到服务器的时间,而且这个时间取决与发送请求的数据量的大小,例如,长的发送时间是由于用PSOT方式上传文件造成的。

5)Waitis the idle time spent waiting for a response message from the server. This value includes delays introduced due to network latency and the time required to process the request on the web server.

等待时间:是花费在等待服务器响应消息的空闲时间,这个值包括网络延迟和服务器处理请求的时间。

6)Receiveis the time taken to read the response message from the server. This value will depend on the size of the content returned, network bandwidth and whether HTTP compression was used.

接收时间:是花费在从服务器读取响应消息的时间。这个值可以受到请求消息内容的大小,网络带宽和是否使用了HTTP压缩

7)TTFB(or Time To First Byte) is theduration from the initial network request being initiated by the browser to the first byte being receivedfrom the server. It includes TCP connection time, the time to send the request and the time taken to get the first byte of the response message.

TTFB(Tome To First Byte)是最初的网络请求被发起到从服务器接收到第一个字节这段时间,它包含了TCP连接时间,发送HTTP请求时间和获得响应消息第一个字节的时间。

8)Networkis the total duration ofall network related operationsfor an HTTP request.

Network:是所有的对一个HTTP请求的相关操作的这段时间。



3.Headers 选项卡 (HTTP请求头和响应头)

  1. Headers
  2. ====================================================================================
  3. Headers Sent      Value
  4. ====================================================================================
  5. (Request-Line)    GET / HTTP/1.1
  6. Acceptapplication/x-shockwave-flash, image/gif, image/jpeg, image/pjpeg,
  7. image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint,
  8. application/msword, application/xaml+xml, application/x-ms-xbap,
  9. application/x-ms-application, */*
  10. Accept-Encoding  gzip, deflate
  11. Accept-Language   zh-cn
  12. ConnectionKeep-Alive
  13. Cookie__utma=22*****93.133*****.1329*****6.1329*****.132*****6.1;
  14. __utmz=225***893.132*****6.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=
  15. (none); Hm_lvt_0e*****1bfd76e83216b=13*****86359;
  16. __pta=1*****65.1*****177.13*****3293.*****389.4;
  17. 3comdo=132*****4820
  18. Hostwww.chinaunix.net
  19. User-Agent       Mozilla/4.(compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0;
  20. .NET4.0C; .NET4.0E)
  21. ====================================================================================
  22. Headers Sent      Value
  23. ====================================================================================(Status-Line)   HTTP/1.1 200 OK
  24. Connection      close
  25. Content-Length   959
  26. Content-Type     text/html

们从上面可以看到:

1)浏览器要求使用长连接ConnectionKeep-Alive),但是服务器使用的是短连接Connectionclose).

2)请求头的基本格式:

首先是请求行,其格式是:Action(get或者post或者...) + 资源的路径(/)+ HTTP协议的版本(HTTP/1.1)

接下来是“请求头”,即浏览器的各种参数:

Accept表示浏览器可以接受的资源类型;

Accept-Encoding表示浏览器的可以接收的压缩格式类型;

Accept-Language表示浏览器使用的语言;

Cookie是浏览器传输给服务器的cookie信息;

然后是一个 \r\n 用来分隔“请求头”和请求内容

最后是请求的内容。



3)响应头的基本格式:

首先是响应状态行,其格式是:协议(HTTP/1.1)+  状态信息(200 OK);

接下来是“响应头”,就是服务器响应的各种参数;

然后是一个 \r\n 用来分隔“响应头”和请求内容;

最后是请求的内容。


4.Cookie 选项卡 (浏览器传给服务器的cookie)

  1. Cookies
  2. =========================================================================================
  3. CookieName Direction Value Path  Domain        Expires         Source  HTTP Only Secure
  4. =========================================================================================
  5. __pta      Sent***/   .chinaunix.net  Thu,**:28 GMT   Stored    No       No
  6. __utma     Sent       ***   /    .chinaunix.net T***6:26 GMT    Stored    No       No
  7. __utmz     Sent       ***   /    .chinaunix.net T***6:26 GMT    Stored    No       No
  8. 3comdo     Sent       ***   /    .chinaunix.net T**:55 GMT      Stored    No       No
  9. Hm****     Sent       ***   /    .chinaunix.net W***1:36:26 GMT Stored    No       No

5.Cache 选项卡 (浏览器缓存的各种参数)

  1. Cache
  2. ====================================================================================
  3. Decription           Before Request              After Request
  4. ====================================================================================
  5. URL in cache?       Yes                            Yes
  6. Expires(Not set)                    (Not set)
  7. Last Modification    (Not set)                    (Not set)
  8. Last Cache Update    01:36:26 Tue***12 GMT        02:08:10 Tues***12 GMT
  9. Last Access          01:36:24 T***2 GMT           02:08***4, 2012 GMT
  10. ETag
  11. Hit Count           7                             9

其中我们看到,本次访问 http://www.chinaunix.net 利用浏览器缓存中的内容,并没有重新全部从服务器得到所有的内容。Hit Count的表示的是“击中了缓存的次数”
6.Query String 选项卡 (表示通过get方法传给服务器的参数,比如 id=23433&name=dkdkkd等等内容)由于我们访问的是http://www.chinaunix.net所以没有Query String。注意通过数据库注入就是通过Query String来构造各种到数据库查询,从而从返回的结果分析从而得到各种关于数据库的信息的。
7.Stream 选项卡(浏览器传给服务器的数据流,以及服务器返回给浏览器的数据流)

  1. Stream
  2. 750 bytessentto 219.148.35.60:80
  3. ====================================================================================
  4. GET / HTTP/1.1
  5. Accept: application/x-shockwave-flash, image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/xaml+xml, application/x-ms-xbap, application/x-ms-application, */*
  6. Accept-Language: zh-cn
  7. User-Agent: Mozilla/4.(compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET4.0C; .NET4.0E)
  8. Accept-Encoding: gzip, deflate
  9. Host: www.chinaunix.net
  10. Connection: Keep-Alive
  11. Cookie: __utma=***; __utmz=22***)u***e); Hm_lv***b=1***; __pta=157***9.4; 3comdo=****0
  12. ====================================================================================
  13. 1043 bytes received by 127.0.0.1:2011
  14. HTTP/1.1 200 OK
    Content-Length: 959
    Connection: close
    Content-Type: text/html

使用HtttpWatch可以方便地得到各种HTTP运行的信息,上面仅仅是摘录了一小部分来加以分析。

从上面的分析可以清楚的看到HTTP协议运行的各种情况,可以使我们加深对HTTP协议的理解。

在iteye.com上有几篇分析HTTP的博文: http://yzd.iteye.com/blog/1405107  HTTP协议详解,你所不知到的 http://javababy1.iteye.com/blog/1404091  HTTP协议和web本质 http://javasee.iteye.com/blog/1405109 Fiddler宝典

此文参考:http://blog.chinaunix.net/uid-25909722-id-3072233.html

使用 HttpWatch 分析 HTTP 协议相关推荐

  1. 计算机网络协议教案,计算机网络实验教案(6)网络协议分析-IP协议3.pdf

    计算机网络实验教案(6)网络协议分析-IP协议3.pdf (2页) 本资源提供全文预览,点击全文预览即可全文预览,如果喜欢文档就下载吧,查找使用更方便哦! 9.9 积分 <计算机网络实验> ...

  2. Wireshark数据抓包分析(网络协议篇)1.2安装Wireshark

    Wireshark数据抓包分析(网络协议篇)1.2安装Wireshark Wireshark(前称Ethereal)是一个网络包分析工具.该工具主要是用来捕获网络包,并显示包的详细情况.本节将分别介绍 ...

  3. Wireshark数据抓包分析(网络协议篇)第1章网络协议抓包概述

    Wireshark数据抓包分析(网络协议篇)第1章网络协议抓包概述 网络协议是用于不同计算机之间进行网络通信的.网络协议是网络上所有设备(如网络服务器.计算机.交换机.路由器等)之间通信规则的集合,它 ...

  4. Wireshark数据抓包分析——网络协议篇

    Wireshark数据抓包分析--网络协议篇 Wireshark是目前最受欢迎的抓包工具.它可以运行在Windows.Linux及MAC OS X操作系统中,并提供了友好的图形界面.同时,Wiresh ...

  5. 计算机网络数据分析报告,贵州大学计算机网络实验报告-实验四-分析IP协议数据包格式...

    贵州大学计算机网络实验报告-实验四-分析IP协议数据包格式 (7页) 本资源提供全文预览,点击全文预览即可全文预览,如果喜欢文档就下载吧,查找使用更方便哦! 9.9 积分 贵州大学GUIZHOU UN ...

  6. 使用WinPcap抓包分析网络协议

    创建一个使用wpcap.dll的应用程序 用 Microsoft Visual C++ 创建一个使用 wpcap.dll 的应用程序,需要按一下步骤: 在每一个使用了库的源程序中,将 pcap.h头文 ...

  7. 接口协议之抓包分析 TCP 协议

    TCP 协议是在传输层中,一种面向连接的.可靠的.基于字节流的传输层通信协议. 环境准备 对接口测试工具进行分类,可以如下几类: 网络嗅探工具:tcpdump,wireshark 代理工具:fiddl ...

  8. 网络协议分析与仿真课程设计报告:网络流量分析与协议模拟

    公众号:CS阿吉 网络协议分析与仿真课程设计报告  题  目:网络流量分析与协议模拟 专业名称:         网络工程 班    级: 学生姓名:           阿吉 学号(8位): 指导教 ...

  9. BT源代码学习心得(七):跟踪服务器(Tracker)的代码分析(HTTP协议处理对象) -- 转贴自 wolfenstein (NeverSayNever)

    BT源代码学习心得(七):跟踪服务器(Tracker)的代码分析(HTTP协议处理对象) author: wolfenstein (NeverSayNever) 上次我们分析了Tracker类初始化的 ...

  10. 用wireshark抓包分析TCP协议的三次握手连接、四次握手断开

    用wireshark抓包分析TCP协议的三次握手连接.四次握手断开 一.TCP三次握手图解 二.TCP得四次挥手过程 三.用Fiddler抓包,分析验证一个HTTPS网站的TCP连接过程 一.TCP三 ...

最新文章

  1. red hat DHCP服务器配置
  2. 源哥每日一题第十七弹 poj 1568 Alpha-Beta剪枝
  3. python中cv2库_Python cv2库(人脸检测)
  4. 自己写一个实现ApplicationListener​接口并且把该组件加入到容器中
  5. linux删除本机mysql_删除Linux本机自带的Apache/PHP/MySQL
  6. html判断用户名的合法性,javascript简单判断输入内容是否合法的方法
  7. 体重测试java算法代码_标准体重计算示例代码
  8. ajax post请求发送数组后台接收
  9. Spring----Bean装配
  10. Android触控屏幕Gesture(GestureDetector和SimpleOnGestureListener的使用教程) 分类:Androidandroid实例...
  11. JavaSE基础——Map集合、 Collections(集合工具类)
  12. WINRAR青绿色透明主题皮肤 Vista/win 7下效果极佳
  13. 利用python和cloudvolume包从谷歌云盘中多线程下载数据
  14. oracle 数据页,常见数据库分页实现方案-Oracle
  15. 51单片机的红外接收解码
  16. 【python】调用百度智能云API实现手写文字识别
  17. 多传感器融合综述---FOV与BEV
  18. 关于c中的%x及其它格式化符
  19. 《逆袭进大厂》第十二弹之MySQL重点篇27问27答
  20. 文件操作系列之三——(windows中的文件操作)

热门文章

  1. android 资源文件类型,命名规则(配置限定符名称),及其加载规则
  2. 碧蓝航线服务器维护到几点,碧蓝航线9月26日更新官方公告及内容汇总 维护到几点 碧蓝航线什么时候能玩_蚕豆网新闻...
  3. 超五类双绞线,六类双绞线,七类双绞线的细微区别
  4. 了解几种常用的哈希校验码
  5. 信息技术领域会议(技术领域和非技术领域)
  6. ZStack-2.6.2-c74 搭建私有云
  7. 有关找共享单车那些事
  8. 谷歌浏览器 Cookie 设置
  9. 【职业规划】该如何选择职业方向?性能?自动化?测开?学习选择python、java?
  10. android 动态毛玻璃,Android毛玻璃背景效果简单实现代码