计算机网络实验|计算机网络实验 Labexercise1-1 Protocol Layers(Wireshark抓包与协议分析实验)

计算机网络实验 Labexercise1-1 Protocol Layers(Wireshark抓包与协议分析实验) 前言:本博客包含Windows10下安装wget、Wireshark。
一些有用的链接:

  • Labexercise1-1 Protocol Layers翻译
  • wireshark练习及答案lab-protocol-layers.docx
  • Wireshark抓包使用指南
  • 山东大学计算机网络实验
一些有用的提示:
开始实验进行抓包时,校园网环境下的同学不建议使用一些 [ 上网不涉密涉密不上网 ] 的校园网进行抓包,可能会导致抓不到包捏 (找了半天bug,气死我了)
1. 下载安装wget 参考资料:wget for windows 下载与安装
点击此链接,选择合适的版本下载.exe文件,然后把下好的.exe文件放在C:/windows/system32目录下即可。
计算机网络实验|计算机网络实验 Labexercise1-1 Protocol Layers(Wireshark抓包与协议分析实验)
文章图片

在cmd终端输入wget --version,显示如下,则安装成功:
C:\Users\hp\Desktop>wget --version GNU Wget 1.21.2 built on mingw32.+cares +digest +gpgme +https +ipv6 +iri +large-file +metalink -nls +ntlm +opie +psl +ssl/opensslWgetrc: /win32dev/misc/wget/out64/etc/wgetrc (system) Compile: x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/win32dev/misc/wget/out64/etc/wgetrc" -DLOCALEDIR="/win32dev/misc/wget/out64/share/locale" -I. -I../../src -I../lib -I../../lib -I/win32dev/misc/wget/out64/include -I/win32dev/misc/wget/out64/include -I/win32dev/misc/wget/out64/include -I/win32dev/misc/wget/out64/include -DCARES_STATICLIB -I/win32dev/misc/wget/out64/include -DPCRE2_STATIC -I/win32dev/misc/wget/out64/include -DHAVE_LIBSSL -I/win32dev/misc/wget/out64/include -I/win32dev/misc/wget/out64/include -DNDEBUG -ggdb Link: x86_64-w64-mingw32-gcc -I/win32dev/misc/wget/out64/include -I/win32dev/misc/wget/out64/include -I/win32dev/misc/wget/out64/include -DCARES_STATICLIB -I/win32dev/misc/wget/out64/include -DPCRE2_STATIC -I/win32dev/misc/wget/out64/include -DHAVE_LIBSSL -I/win32dev/misc/wget/out64/include -I/win32dev/misc/wget/out64/include -DNDEBUG -ggdb -L/win32dev/misc/wget/out64/lib -L/win32dev/misc/wget/out64/lib -lmetalink -lunistring -liconv -L/win32dev/misc/wget/out64/lib -lcares -L/win32dev/misc/wget/out64/lib -lpcre2-8 -L/win32dev/misc/wget/out64/lib -lssl -lcrypto -L/win32dev/misc/wget/out64/lib -lz -L/win32dev/misc/wget/out64/lib -lpsl -lidn2 -lunistring -liconv -lws2_32 -lole32 -lcrypt32 -lexpat -L/win32dev/misc/wget/out64/lib -lgpgme -lassuan -lgpg-error ftp-opie.o mswindows.o openssl.o http-ntlm.o ../lib/libgnu.a -lws2_32 -lws2_32 -lws2_32 -lws2_32 -lws2_32 -lws2_32 /win32dev/misc/wget/out64/lib/libiconv.a /win32dev/misc/wget/out64/lib/libunistring.a -lws2_32Copyright (C) 2015 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.Originally written by Hrvoje Niksic . Please send bug reports and questions to .

尝试使用wget时,可以在终端输入wget 网址把目标链接下载到当前目录下,也可以输入wegt -p 指定目录 网址把目标链接下载到指定目录下。
2. 下载安装Wireshark 参考资料:win10安装抓包工具wireshark
在Wireshark的官网下载地址中,在Stable Release中选择符合你计算机型号的安装包,我Windows10 64位电脑选择的是 Windows Installer (64-bit),双击下载的.exe文件进行安装。
如果你仅仅只是为了完成课程实验,在安装的过程当中可以一路无脑next,在选择安装路径时可以更改为你想要的路径。
3.开始实验 Step 1-3
打开Wireshark,界面如下图所示,选择WLAN,点击捕获-选项。
计算机网络实验|计算机网络实验 Labexercise1-1 Protocol Layers(Wireshark抓包与协议分析实验)
文章图片

在捕获选项界面,仅勾选WLAN,取消其他接口的混杂,在下方绿色的部分输入tcp port 80,使用“tcp端口80”筛选器启动捕获。
计算机网络实验|计算机网络实验 Labexercise1-1 Protocol Layers(Wireshark抓包与协议分析实验)
文章图片

打开cmd终端,抓包一个网站,这里选择的是https://www.baidu.com/,网页获取完成后,立刻在Wireshark点击左上角的停止(红色正方形),显示如下图。
计算机网络实验|计算机网络实验 Labexercise1-1 Protocol Layers(Wireshark抓包与协议分析实验)
文章图片

计算机网络实验|计算机网络实验 Labexercise1-1 Protocol Layers(Wireshark抓包与协议分析实验)
文章图片

找到上方Protocol为HTTP,且Info是GET的,点击蓝色部分的Hypertext,可以看到整个窗口的最下方显示415 byte(s),这是HTTP的实际有效开销。

接下来分别查看以太网(Ethernet)、IP、TCP占用的字节,分别如下为14 types、20 types、20 types。
计算机网络实验|计算机网络实验 Labexercise1-1 Protocol Layers(Wireshark抓包与协议分析实验)
文章图片

计算机网络实验|计算机网络实验 Labexercise1-1 Protocol Layers(Wireshark抓包与协议分析实验)
文章图片

计算机网络实验|计算机网络实验 Labexercise1-1 Protocol Layers(Wireshark抓包与协议分析实验)
文章图片

由此,可以回答实验报告中的第一个 turn in:
Step 3: Packet Structure
Turn-in: Hand in your packet drawing.
计算机网络实验|计算机网络实验 Labexercise1-1 Protocol Layers(Wireshark抓包与协议分析实验)
文章图片

Step 4
Protocol Overhead指的是协议开销,由于协议本身的报头等内容也需要占用一定的空间,用来标识该种协议、报文内各个字段的含义等信息,这种内容就是协议开销了。
下载的包从一个Info中带有SYN,ACK信号的包开始,到下面第一个遇到的HTTP包后面的TCP包为止。
由此,可以回答实验报告中的第二个 turn in:
Your estimate of download protocol overhead as defined above. Tell us whether you find this overhead to be significant.
计算机网络实验|计算机网络实验 Labexercise1-1 Protocol Layers(Wireshark抓包与协议分析实验)
文章图片

协议开销一共有 66+54+469+66=665字节
HTTP有效开销一共有415字节,415/665≈62.41%,协议开销占比较小。
Step 5
【计算机网络实验|计算机网络实验 Labexercise1-1 Protocol Layers(Wireshark抓包与协议分析实验)】点击中间那一栏的以太网和IP,分别可以从Type和Protocol中找到第五步问题的答案。
由此,可以回答实验报告中的第三个 turn in:
  1. Which Ethernet header field is the demultiplexing key that tells it the next higher layer is IP? What value is used in this field to indicate “IP”?
    计算机网络实验|计算机网络实验 Labexercise1-1 Protocol Layers(Wireshark抓包与协议分析实验)
    文章图片

    以太网报头字段是Type,对应的值是0x0800。
  2. Which IP header field is the demultiplexing key that tells it the next higher layer is TCP? What value is used in this field to indicate “TCP”?
    计算机网络实验|计算机网络实验 Labexercise1-1 Protocol Layers(Wireshark抓包与协议分析实验)
    文章图片

    IP报头字段是Protocol,对应的值是6。

    推荐阅读