实验文件地址

http://www-net.cs.umass.edu/wireshark-labs/Wireshark_IP_v7.0.pdf
在这里插入图片描述

Question & Answer

1. Select the first ICMP Echo Request message sent by your computer, and expand the Internet Protocol part of the packet in the packet details window. What is the IP address of your computer?

在这里插入图片描述

2. Within the IP packet header, what is the value in the upper layer protocol field?

在这里插入图片描述

3. How many bytes are in the IP header? How many bytes are in the payload of the IP datagram? Explain how you determined the number of payload bytes.

在这里插入图片描述

There are 20 bytes in the IP header
The length of the payload of the IP datagram is 84 - 20 = 64 bytes.

4. Has this IP datagram been fragmented? Explain how you determined whether or not the datagram has been fragmented.

在这里插入图片描述

// mf = more fragments
uint16_t offset= ntoh16(iphdr->offset);
bool df= offset&IP_DF != 0;
bool mf= offset&IP_MF != 0;
offset &= IP_OFFMASK;
 
bool is_fragment= true;
if(mf)
{
	if(offset== 0) //first.
	{
	}
	else //middle.
	{
	}
}
else
{
	if(offset== 0) //complete.
	{
		is_fragment= false;
	}
	else //last
	{
	}
}

5. Which fields in the IP datagram always change from one datagram to the next within this series of ICMP messages sent by your computer?

在这里插入图片描述

6. Which fields stay constant? Which of the fields must stay constant? Which fields must change? Why?

在这里插入图片描述

stay constant : 
Version
Header Length
Differentiated Services Field
Flags
Protocol
Source Address
Destination Address 

must change:
Identification
Time to Live
Checksum

7. Describe the pattern you see in the values in the Identification field of the IP datagram.

因为IP是无可靠服务,报文不可以按序接收(TCP可以实现按序接收)。
但当报文长度超过MTU而必须分片时,这字段来标识多个分片是否属于同一个报文(同一个报文的标识符相同)。
该字段Flags和Fragment Offest 结合实现在接受端组合分片报文

8. What is the value in the Identification field and the TTL field?

在这里插入图片描述

9. Do these values remain unchanged for all of the ICMP TTL-exceeded replies sent to your computer by the nearest (first hop) router? Why?

不变。当这个IP封包通过一个路由器时,TTL才会减一。

10. Find the first ICMP Echo Request message that was sent by your computer after you changed the Packet Size in pingplotter to be 2000. Has that message been fragmented across more than one IP datagram?

信息将会被分片。
这是因为收集跟踪的计算机上有一个以太网卡将最大IP数据包的长度限制为1500个字节。

11. Print out the first fragment of the fragmented IP datagram. What information in the IP header indicates that the datagram been fragmented? What information in the IP header indicates whether this is the first fragment versus a latter fragment? How long is this IP datagram?

在这里插入图片描述

Flags:0x20   # 表明分片
Fragment Offset: 0	# 表明第一个分片
Total Length: 1500	# 表明总长度

12. Print out the second fragment of the fragmented IP datagram. What information in the IP header indicates that this is not the first datagram fragment? Are the more fragments? How can you tell?

在这里插入图片描述

Fragment Offset: 1480	# 表明不是第一个分片
由于包大小为2000bytes,一个分片最大为1500bytes,只能够分成两个片,故后面不会再有更多的分片。

13. What fields change in the IP header between the first and second fragment?

Fragment Offser & Header Checksum

14. How many fragments were created from the original datagram?

将会创造3个分片。

15. What fields change in the IP header among the fragments?

Header Checksum

原文地址:http://www.cnblogs.com/astralcon/p/16792659.html

1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长! 2. 分享目的仅供大家学习和交流,请务用于商业用途! 3. 如果你也有好源码或者教程,可以到用户中心发布,分享有积分奖励和额外收入! 4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解! 5. 如有链接无法下载、失效或广告,请联系管理员处理! 6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需! 7. 如遇到加密压缩包,默认解压密码为"gltf",如遇到无法解压的请联系管理员! 8. 因为资源和程序源码均为可复制品,所以不支持任何理由的退款兑现,请斟酌后支付下载 声明:如果标题没有注明"已测试"或者"测试可用"等字样的资源源码均未经过站长测试.特别注意没有标注的源码不保证任何可用性