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


前言:本博客包含Windows10下安装wget、Wireshark。

一些有用的链接:

一些有用的提示:

开始实验进行抓包时,校园网环境下的同学不建议使用一些 [ 上网不涉密涉密不上网 ] 的校园网进行抓包,可能会导致抓不到包捏 (找了半天bug,气死我了)

1. 下载安装wget

参考资料:wget for windows 下载与安装

点击此链接,选择合适的版本下载.exe文件,然后把下好的.exe文件放在C:/windows/system32目录下即可。

在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/openssl Wgetrc:
/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_32 Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://www.gnu.org/licenses/gpl.html>.
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 <hniksic@xemacs.org>.
Please send bug reports and questions to <bug-wget@gnu.org>.

尝试使用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,点击捕获-选项。

在捕获选项界面,仅勾选WLAN,取消其他接口的混杂,在下方绿色的部分输入tcp port 80,使用“tcp端口80”筛选器启动捕获。

打开cmd终端,抓包一个网站,这里选择的是https://www.baidu.com/,网页获取完成后,立刻在Wireshark点击左上角的停止(红色正方形),显示如下图。



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

接下来分别查看以太网(Ethernet)、IP、TCP占用的字节,分别如下为14 types、20 types、20 types。





由此,可以回答实验报告中的第一个 turn in:

Step 3: Packet Structure

Turn-in: Hand in your packet drawing.

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.



协议开销一共有 66+54+469+66=665字节

HTTP有效开销一共有415字节,415/665≈62.41%,协议开销占比较小。

Step 5

点击中间那一栏的以太网和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”?



    以太网报头字段是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”?



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

最新文章

  1. PrototypePattrn(原型模式)
  2. 简要介绍BASE64、MD5、SHA、HMAC几种方法。
  3. IUS database
  4. 22.mongodb副本集集群
  5. Windows Azure Cloud Service (47) 修改Cloud Service时区
  6. 在报表中给session赋值实现报表间参数共享
  7. Hibernate框架的总结
  8. Django 的css和js压缩插件:django_compressor
  9. oracle,sqlserver,mysql 命令行 开启、关闭所需要的服务
  10. 日期操作类--Date类
  11. js事件知识整理
  12. SSRS中加入书签功能及数据集窗口
  13. 393. UTF-8 Validation
  14. Features of Spring Web MVC
  15. Intent的几种Flag的不同
  16. Matches Puzzle Game
  17. HTTP长连接、短连接使用及测试
  18. 【其他】Objective-C 内存管理学习总结
  19. Flask 系列之 部署发布
  20. Observable详解

热门文章

  1. kdj
  2. Xml的一些基本概念(摘抄自w3school.com.cn)
  3. HowToDoInJava 其它教程 1 &amp;#183; 翻译完成
  4. 解决Vue3使用 Ant Design,出现多个Modal,全是黑屏,导致列表页看不见问题!
  5. tcp 中 FLAGS字段,几个标识:SYN, FIN, ACK, PSH, RST, URG.
  6. Net6 DI源码分析Part1 ServiceCollection、ServiceDescriptor、ServiceLifetime、IServiceProvider
  7. Html设置文本换行与不按行操作
  8. LBS应用之 根据一点的经纬度实现附近点的查询
  9. jdk1.5新特性之-------&gt;可变参数
  10. Redis高可用(持久化、主从复制、哨兵、集群)