Wireshark实验 UDP

使用的资料

计算机网络自顶向下方法 第7版

实验手册

参考前人第六版资料

Wireshark-win64-3.4.2

操作系统:Windows 7

实验步骤

Select one UDP packet from your trace. From this packet, determine how many fields there are in the UDP header. (You shouldn’t look in the textbook! Answer these questions directly from what you observe in the packet trace.) Name these fields.

包含4部分,源端口号,目的端口号,长度(首部长度+数据长度)和校验和。

image-20210207101229200.png

By consulting the displayed information in Wireshark’s packet content field for this packet, determine the length (in bytes) of each of the UDP header fields.

由上图两部分做差,847-839=8B,因此UDP的首部长度为8字节。

The value in the Length field is the length of what? (You can consult the text for this answer). Verify your claim with your captured UDP packet.

第一问已经说明,长度是首部和数据两部分长度之和。

What is the maximum number of bytes that can be included in a UDP payload? (Hint: the answer to this question can be determined by your answer to 2. above)

长度部分占16位,UDP最大长度2^16 = 65536字节,去掉首部所占用的8字节,有效载荷为65528B。

What is the largest possible source port number? (Hint: see the hint in 4.)

16位全为1,因此为65535。

What is the protocol number for UDP? Give your answer in both hexadecimal and decimal notation. To answer this question, you’ll need to look into the Protocol field of the IP datagram containing this UDP segment (see Figure 4.13 in the text, and the discussion of IP header fields).

常规知识,UDP的协议号17,十六进制为0x0011。

Examine a pair of UDP packets in which your host sends the first UDP packet and the second UDP packet is a reply to this first UDP packet. (Hint: for a second packet to be sent in response to a first packet, the sender of the first packet should be the destination of the second packet). Describe the relationship between the port numbers in the two packets.

发送方和接收方的目的端口号和源端口号颠倒过来(图中未截取)。

总结

UDP的实验比较简短,姑且作为春节前保持手感的练习。最近除了摸鱼外,还刷了些leetcode算法(误),从上个月月底就开始懒洋洋的。