Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ title: 计算机网络


!!! warning "施工中"


Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: 计算机网络实践
---

## 2023-2024学年上学期

### 刘献忠

- 实验比较简单, 要求也比隔壁班低, 最后一个 socket lab 作业要求也比隔壁低
- [SOCKET_LAB](https://github.com/KirisameVanilla/SOCKET_LAB)

### 王廷

- 听我同学说实验比较难

## 2024-2025学年上学期

### 王廷

#### 实验报告

除第一个实验外,其余实验所用到的 `.pcapng` 文件均附在对应文件夹下

- [lab1](./lab/lab1/lab1.md)
- [lab2 Ethernet](./lab/lab2/lib2)
- [lab3 IPV4](./lab/lab3/lib3)
- [lab4 ARP](./lab/lab4/lib4)
- [lab5 UDP](./lab/lab5/lib5)
- [lab6 TCP](./lab/lab6/lib6)
- [lab7 Socket Programming](./lab/lab7/lib7)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
title: Lab1
---

# 华东师范大学软件学院实验报告

## 一、实验目的

1. 学会使用curl与wget指令

2. 学会通过Wireshark获取数据包

3. 了解协议层数据包的结构

4. 学会计算并分析协议开销

## 二、实验内容与实验步骤

1. 在控制台中输入`curl http://1st.moe/`,并观察到`200 OK`

2. 启动Wireshark,选择监听以太网,并将捕获过滤器设置为tcp port 80,关闭混杂模式,并启用"enable network name resolution"选项

3. 关闭所有浏览器窗口后开始捕获

4. 重新在控制台输入 `curl http://1st.moe/`

5. 停止Wireshark捕获

## 三、实验环境

B226机房电脑

## 四、实验过程与分析

1. 实验过程

捕获内容如图所示

![捕获内容](./Pictures/100000010000094B000002EADEAFEA2E.png)

2.
分析协议包的内容

![协议包内容1](./Pictures/10000001000003320000015C8A9E98EE.png)
![协议包内容2](./Pictures/100000010000032800000154F3640027.png)
![协议包内容3](./Pictures/100000010000032900000152B123680E.png)
![协议包内容4](./Pictures/100000010000033300000151977B0DF0.png)

根据如上四张图片,可以发现各个协议所占的字节数为

| 协议 | 字节数 |
|-------------------------------------|-----------|
| Ethernet (eth) | 14 bytes |
| Internet Protocol Version 6 (ipv6) | 40 bytes |
| Transmission Control Protocol (tcp) | 20 bytes |
| Hypertext Transfer Protocol (http) | 128 bytes |

则包的结构大致如下

| eth | ip | tcp | http |
|-----------------|------------------|----------|-----------|
| 14 bytes | 40 bytes | 20 bytes | 128 bytes |
| Ethernet Header | Ethernet Payload | | |
| IP Header | IP Payload | | |

3. 问题

1. 分析协议开销

一个GET本身的大小为128
bytes,而其相应产生的SYN、ACK请求也应算入其开销中。根据图片
![alt](./Pictures/10000001000004EE0000005E50C8B369.png)
可以计算得出由于协议产生的总开销为86+74+(202-128)+74=308
bytes,从而计算得出比值约为0.4156,考虑到信息传输的稳定性,协议开销是值得的。

2. 以太网头部中哪一部分是解复用键并且告知它的下一个高层指的是IP,在这一包内哪一个值可以表示IP

根据图片
![alt](./Pictures/10000001000004000000007864293250.png)
![alt](./Pictures/1000000100000470000000F4B4E41AC7.png)
可以直观看出ipv6对应的分解键为0x86dd,tcp对应的分解键为6

4. 故障分析

在实验过程中出现了控制台有反馈但Wireshark没有捕获的情况,经排查后发现是由于控制台指令输入错误:误将http输入为https所致。

## 五、实验结果总结

1. 实验完成了对一个HTTP包的拆解与分析,其大体结构大致如下

|th|ip|tcp|http|
|-|-|--|-|
| 14 bytes | 40 bytes | 20 bytes | 128 bytes |
| Ethernet Header | Ethernet Payload | | |
| IP Header | IP Payload | | |

2. 实验通过curl指令与Wireshark软件完成,在其中熟悉网络工具的使用,并体会到其强大之处

3. 通过查询相关资料,了解开销、分解键等概念
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
title: Lab2 - Ethernet
---

# 华东师范大学软件学院实验报告

## 一、实验目的

学习以太网帧的组成

## 二、使用内容与实验步骤

1. 捕获帧
1. 对一个远程服务器使用 ping 指令发送信息,并检查是否有回复;
2. 启动 Wireshark ,选择过滤 icmp ,开启“启用 MAC 名称解析”选项,开始捕获以太网帧;
3. 重复第一步;
4. 终止 ping 指令,返回 Wireshark 并停止捕获。
2. 检查捕获到的数据
1. 选择捕获到的任意数据包,查看其结构与组成数据包字节的详细信息;
2. 展开以太网报头字段并查看详细信息。
3. 以太网帧结构
绘制一个显示以太网头字段位置与大小的 ping 报文图。
4. 以太网地址范围
绘制一张图,显示电脑、路由器、远程服务器的相对位置。
用以太网地址标注计算机与路由器,IP 地址标注计算机与远程服务器。
并显示以太网和互联网其他部分在图中的位置。
5. 广播帧
启动 Wireshark ,选择过滤 ether multicast ,等待一段时间,捕获广播与组播以太网帧,并根据结果完成以下两个任务:
1. 找到广播以太网地址
2. 找到以太网地址的哪一位确认是单播还是组播

## 三、实验环境

- 实验仪器:ThinkPad X230i
- 操作系统:Arch GNU/Linux x86\_64
- 以太网控制器:Intel Corporation 82575LM Gigabit Network Connection
- 网络控制器:Realtek Semiconductor Co., Ltd. RTL8188CE 820.11b/g/n WiFi Adapter
- 网络连接:校园网ECNU-1X

## 四、实验过程与分析

1. 捕获帧
![ping](./lib2-1.png)
![Wireshark](./lib2-2.png)
2. 检查捕获到的数据
![ping](./lib2-3.png)
3. 以太网帧结构
<table>
<tr>
<td align="center" colspan='3'>Ethernet II</td>
<td align="center">IP&ICMP</td>
</tr>
<tr>
<td align="center">Destination</td>
<td align="center">Source</td>
<td align="center">Type</td>
<td align="center" rowspan='2'>60 Bytes</td>
</tr>
<tr>
<td align="center">6 Bytes</td>
<td align="center">6 Bytes</td>
<td align="center">2 Bytes</td>
</tr>
<tr>
<td align="center" colspan='3'>Ethernet Header</td>
<td align="center">Ethernet Payload</td>
</tr>
</table>
4. 以太网地址范围
![mermaid](./lib2-5.png)
5. 广播帧
捕获内容如图:
![broadcast](./lib2-4.png)
1. 以太网地址为 ff:ff:ff:ff:ff:ff,在 Wireshark 中标注为 Broadcast
2. 第一个字节的末位为1是组播,反之则是单播,所有比特均为1则是广播

## 五、试验结果总结

在本次实验中,我顺利地完成了各项任务,了解并学习到了以太网传输的各项细节
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
traceroute to 1st.moe (52.74.232.59), 30 hops max, 60 byte packets
1 * * *
2 10.100.5.1 (10.100.5.1) 8.795 ms 8.962 ms 9.096 ms
3 202.120.95.246 (202.120.95.246) 9.451 ms 9.092 ms 9.243 ms
4 202.120.95.254 (202.120.95.254) 12.480 ms 12.777 ms 13.331 ms
5 10.255.16.1 (10.255.16.1) 12.974 ms 13.249 ms 12.734 ms
6 10.255.249.253 (10.255.249.253) 12.382 ms 11.127 ms 11.127 ms
7 10.255.38.254 (10.255.38.254) 10.087 ms 9.632 ms 9.452 ms
8 202.112.27.13 (202.112.27.13) 9.268 ms 6.546 ms 6.331 ms
9 101.4.117.58 (101.4.117.58) 6.248 ms 9.316 ms 9.147 ms
10 * * *
11 101.4.115.250 (101.4.115.250) 37.316 ms 37.288 ms 36.908 ms
12 * * *
13 * * 101.4.114.194 (101.4.114.194) 33.724 ms
14 101.4.114.170 (101.4.114.170) 38.219 ms 101.4.117.102 (101.4.117.102) 44.767 ms 44.589 ms
15 101.4.114.222 (101.4.114.222) 67.753 ms 67.658 ms 63.246 ms
16 203.131.254.213 (203.131.254.213) 85.750 ms 85.593 ms 85.431 ms
17 203.131.242.222 (203.131.242.222) 67.546 ms 67.933 ms 67.157 ms
18 52.93.157.242 (52.93.157.242) 67.671 ms 52.93.157.226 (52.93.157.226) 67.991 ms 68.002 ms
19 52.93.35.125 (52.93.35.125) 67.392 ms 52.93.35.109 (52.93.35.109) 68.086 ms 52.93.35.35 (52.93.35.35) 68.009 ms
20 * * *
21 * * *
22 * * *
23 * * *
24 * * *
25 * * *
26 * * *
27 * * *
28 * * *
29 * * *
30 * * *
Loading
Loading