# 網絡基本功(二十八):Wireshark抓包實例分析HTTP問題(下)
**轉載請在文首保留原文出處:EMC中文支持論壇**[https://community.emc.com/go/chinese](https://community.emc.com/go/chinese) [](https://community.emc.com/servlet/JiveServlet/showImage/2-870583-108192/image001.gif)
## 介紹
本文承接上文。
## 更多信息
**Client errors:**
| ?**Code**? | ?**Status**? | ?**Explanation**? | ?**What??? to do**? |
| --- | --- | --- | --- |
| 400 | Bad?? request | The?? request could not be understood by the server due to a syntax problem.?? The request should be modified by the client before resending to it. | Check the?? website address. This can also happen due to a site error. |
| 401 | Authorization?? required | The?? client is denied access due to the lack of authentication codes. | Check?? your username and password. |
| 402 | Payment?? required | Reserved?? for future use. |
| 403 | Forbidden | The?? client is not allowed to see a specific file. This can be due to the server?? access limit. | Check the?? credentials. Also, there are fewer chances that the server is loaded. |
| 404 | Not found | The?? requested resource could not be found. | This can?? be because the resource was deleted, or it never existed before. It can also?? be due to URL misspellings. |
| 405 | Method?? not allowed | The?? method you are using to access the file is not supported or not allowed by?? the resource. |
| 406 | Not?? acceptable | Content?? generated by the resource is not acceptable according to the client request. | Check/update?? your browser. |
| 407 | Proxy?? authentication required | Request?? authentication is required before it can be performed. | The?? client must first authenticate itself with the proxy. |
| 408 | Request?? timed out | It took?? the server longer than the allowed time to process the request. | Check?? response time and load on the network. |
| 409 | Conflict | The?? request submitted by the client cannot be completed because it?? conflicts with some established rules. | Can be?? because you try to upload a file that is older that the existing one or?? similar problems. Check what the client is trying to do. |
| 410 | Gone | The URL?? requested by the client is no longer available from that system. | Usually?? this is a server problem. It can be due to a file that was deleted or?? location was forwarded to a new location. |
| 411 | Content?? length required | The?? request is missing itsContent-Length header. | Compatibility?? issue on a website. Change/update your browser. |
| 412 | Precondition?? failed | The?? client has not set up a configuration that is required for the file to be?? delivered. | Compatibility?? issue on a website. Change/update your browser. |
| 413 | Request?? entity too long | The?? requested file was too big to process. | Server?? limitation. |
| 414 | Request?? URI too long | The?? address you entered was overly long for the server. | Server?? limitation. |
| 415 | Unsupported?? media type | The file?? type of the request is not supported. | Server?? limitation. |
以下示例是一個簡單的客戶端報錯。按照以下步驟進行操作:
1. 右鍵有報錯的報文。
2. 選擇**Follow TCP stream**,會看到以下窗口:
[](https://community.emc.com/servlet/JiveServlet/showImage/2-870583-108193/image002.jpg)
3. 顯示以下內容:
* 客戶端嘗試瀏覽URI/poker-client/broadcast.htm(如截屏中1和3所示)
* URI通過[http://www.888poker.com/poker-client/promotions.htm轉發(截屏中2](http://www.888poker.com/poker-client/promotions.htm轉發(截屏中2)所示)
* 狀態碼為404 Not Found(如截屏中4所示)
**Client errors:**
| ?**Code**? | ?**Status**? | ?**Explanation**? | ?**What??? to do**? |
| --- | --- | --- | --- |
| 500 | Internal?? server error | The web?? server encountered an unexpected condition that prevented it from?? carrying out the client request for access to the requested URL. | Response?? that is usually caused by a problem in your Perl code when a CGI program is?? run. |
| 501 | Not?? implemented | The?? request cannot be executed by the server. | A server?? problem. |
| 502 | Bad?? gateway | The?? server you're trying to reach is sending back errors. | A server?? problem. |
| 503 | Service?? unavailable | The?? service or file that is being requested is not currently available. | A server?? problem. |
| 504 | Gateway?? timeout | The?? gateway has timed out. This message is like the 408 timeout?? error, but this one occurs at the gateway of the server. | Server is?? down or nonresponsive. |
| 505 | HTTP?? version not supported | The HTTP?? protocol version that you want to use for communicating with the server is?? not supported by it. | Server?? does not support the HTTP version. |
服務器不可用(錯誤代碼503)可能有多種原因。以下示例是一個小辦公室碰到的問題:員工能夠訪問Facebook,但當他們點擊站點上的鏈接,則顯示頁面被攔截。以下截屏中,可看出頁面被防火墻攔截:
[](https://community.emc.com/servlet/JiveServlet/showImage/2-870583-108194/image003.jpg)
**工作原理:**
標準的HTTP瀏覽模式如下:
1. TCP打開連接(三路握手信號)
2. HTTP發送GET命令
3. 數據下載到瀏覽器
在一個網頁打開多個連接的情況下(大多數網頁都是如此)。每個連接需要一個DNS 查詢,響應,TCP SYN-SYN/ACK-ACK,以及HTTP GET。之后數據才會出現在顯示屏上。
當你在packet detail面板沒有看到顯示內容時,右鍵報文并選擇Follow TCP stream,會看到連接的細節數據。另一個廣泛應用的工具是Fiddler,Fiddler是HTTP故障排查的免費工具。
## 參考
Network Analysis Using Wireshark Cookbook
- 介紹
- 網絡基本功(一):細說網絡傳輸
- 網絡基本功(二):細說交換機
- 網絡基本功(三):細說VLAN與Trunk
- 網絡基本功(四):細說路由(上)
- 網絡基本功(五):細說路由(下)
- 網絡基本功(六):鏈路聚合
- 網絡基本功(七):細說IP地址與子網
- 網絡基本功(八):細說TCP滑動窗口
- 網絡基本功(九):細說TCP重傳
- 網絡基本功(十):細說TCP確認機制
- 網絡基本功(十一):TCP窗口調整與流控
- 網絡基本功(十二):細說Linux網絡配置(上)
- 網絡基本功(十三):細說Linux網絡配置(下)
- 網絡基本功(十四):細說診斷工具ping
- 網絡基本功(十五):細說網絡性能監測與實例(上)
- 網絡基本功(十六):細說網絡性能監測與實例(下)
- 網絡基本功(十七):細說tcpdump的妙用(上)
- 網絡基本功(十八):細說tcpdump的妙用(下)
- 網絡基本功(十九):細說NAT原理與配置
- 網絡基本功(二十):細說ICMP和ARP
- 網絡基本功(二十一):細說HTTP(上)
- 網絡基本功(二十二):細說HTTP(下)
- 網絡基本功(二十三):Wireshark抓包實例診斷TCP連接問題
- 網絡基本功(二十四):Wireshark抓包實例分析TCP重傳
- 網絡基本功(二十五):Wireshark抓包實例分析TCP重復ACK與亂序
- 網絡基本功(二十六):Wireshark抓包實例分析TCP窗口及reset
- 網絡基本功(二十七):Wireshark抓包實例分析HTTP問題(上)
- 網絡基本功(二十八):Wireshark抓包實例分析HTTP問題(下)
- 網絡基本功(二十九):Wireshark抓包實例診斷數據庫常見問題
- 網絡基本功(三十):細說DNS(上)
- 網絡基本功(三十一):細說DHCP