wireshark抓包分析报文

现行计算机网络体系结构

整个报文以太网协议(物理链路) -> ip协议(网络) -> tcp/udp(传输层) -> 应用软件封装协议 (应用层)

报文封装过程

wireshark抓包分析报文_第1张图片

物理链路层 以太网帧

wireshark抓包分析报文_第2张图片

网络层 ip报头

wireshark抓包分析报文_第3张图片

传输层

UDP报头

wireshark抓包分析报文_第4张图片

TCP报头

wireshark抓包分析报文_第5张图片

应用层

Http

Request

wireshark抓包分析报文_第6张图片

Response

wireshark抓包分析报文_第7张图片

举例

http Request

请求消息
PigRcF.jpg
详细请求报文
wireshark抓包分析报文_第8张图片
因此分析如下

以太网帧

以太网 目的地Destination: Shenzhen_12:af:04 (74:c3:30:12:af:04)
以太网 源地址Source: 46:34:57:62:57:96 (46:34:57:62:57:96)
以太网 类型 Type: IPv4 (0x0800)

IP报文

ip报文Header Length: 20 bytes (5)
ip 报文 总长度 Total Length: 495
ip标识Identification: 0x5cbd (23741)
ip 生存时间 Time to live: 128
ip 协议 Protocol: TCP (6)
ip 源地址Source: 192.168.0.100
ip 目的地址 Destination: 101.69.121.105

TCP报文

tcp 源端口 Source Port: 21649
tcp 目的端口Destination Port: 80
tcp 确认号 Acknowledgment number: 1

http 请求

http 请求方式Request Method: GET
http 请求资源URL Request 
URI: /c_zoom,h_103/c_cut,x_0,y_0,w_155,h_103/os/news/c0a796c969d136b82e57427155
f4a1d6.jpg 
http 版本 Request Version: HTTP/1.1
http 请求主机 Host: 29e5534ea20a8.cdn.sohucs.com
http 请求客户端信息 
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

http Response

响应消息
Pig6hV.jpg
详细响应报文
wireshark抓包分析报文_第9张图片

以太网帧

以太网 目的地Destination: 46:34:57:62:57:96 (46:34:57:62:57:96)
以太网 源地址Source: Shenzhen_12:af:04 (74:c3:30:12:af:04)
以太网 类型 Type: IPv4 (0x0800)

IP报文

ip报文Header Length: 20 bytes (5)
ip 报文 总长度 Total Length: 457
ip标识Identification: 0xfe19 (65049)
ip 生存时间 Time to live: 56
ip 协议 Protocol: TCP (6)
ip 源地址Source: 101.69.121.105
ip 目的地址 Destination: 192.168.0.100

TCP报文

tcp 源端口 Source Port: 80
tcp 目的端口Destination Port: 21649
tcp 确认号 Sequence number: 27361  

http 响应

http 版本 Request Version: HTTP/1.1
http 响应码 Status Code: 200  
http 响应码描述 [Status Code Description: OK] (表示请求已成功,请求所希望的响应头或数据体将随此响应返回) 
http 文件类型 Content-Type: image/jpeg (jpeg格式的图片字节流文件)
http 文件长度 Content-Length: 27284 

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