Check if you are behind a transparent proxy

文章出处:http://www.sajalkayan.com/check-if-you-are-behind-a-transparent-proxy.html


Many Asian ISPs do not provide clean internet. They route all HTTP sessions thru atransparent proxy.Here is a simple way to check if you are behind one.


sajal@sajal-laptop:~$ ping -c 4 www.cdnplanet.com
PING www.cdnplanet.com (107.20.181.99) 56(84) bytes of data.
64 bytes from ec2-107-20-181-99.compute-1.amazonaws.com (107.20.181.99): icmp_req=1 ttl=42 time=314 ms
64 bytes from ec2-107-20-181-99.compute-1.amazonaws.com (107.20.181.99): icmp_req=2 ttl=42 time=313 ms
64 bytes from ec2-107-20-181-99.compute-1.amazonaws.com (107.20.181.99): icmp_req=3 ttl=42 time=312 ms
64 bytes from ec2-107-20-181-99.compute-1.amazonaws.com (107.20.181.99): icmp_req=4 ttl=42 time=312 ms

--- www.cdnplanet.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 312.195/313.229/314.137/0.889 ms

sajal@sajal-laptop:~$ ab http://www.cdnplanet.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.cdnplanet.com (be patient).....done


Server Software:        Apache
Server Hostname:        www.cdnplanet.com
Server Port:            80

Document Path:          /
Document Length:        13084 bytes

Concurrency Level:      1
Time taken for tests:   0.944 seconds
Complete requests:      1
Failed requests:        0
Write errors:           0
Total transferred:      13296 bytes
HTML transferred:       13084 bytes
Requests per second:    1.06 [#/sec] (mean)
Time per request:       943.539 [ms] (mean)
Time per request:       943.539 [ms] (mean, across all concurrent requests)
Transfer rate:          13.76 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       21   21   0.0     21      21
Processing:   922  922   0.0    922     922
Waiting:      611  611   0.0    611     611
Total:        944  944   0.0    944     944
sajal@sajal-laptop:~$ 


My ping time to CDN Planet is 312ms, but the connection was established in just 21ms !!!!11!!1Reasons for doing so involve : Censorship, big brother snooping, caching,hijacking users sessions , and probably more ...



上面内容为转载,以下通过实际的抓包来分析一下ab输出结果中最后一部分的含义:

测试中ab的实际输出为:

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      279  279   0.0    279     279
Processing:   730  730   0.0    730     730
Waiting:      259  259   0.0    259     259
Total:       1009 1009   0.0   1009    1009

部分抓包截图如下:


。。。


分析可知,

Connect 279      ------      三次握手的建立时间

Processing 730 ------      从发送GET请求到接收完成的时间

Waiting 259        -------    从发送GET请求到接收到第一个应答数据段的间隔

Total 1009          ------      Connect时间加上Processing时间





你可能感兴趣的:(网络基础)