diff --git a/Readme.md b/Readme.md index 6547d85..2d5ae91 100644 --- a/Readme.md +++ b/Readme.md @@ -11,11 +11,11 @@ 项目根目录下的目录功能如下: -* book:实验指导书主文件 * data:实验指导书分章节内容 -* code:参考代码 +* config:实验指导书格式配置文件 * figure:用到的图片 -* bib:参考文献 + +* code:参考代码 ## 3. 编译 @@ -29,16 +29,21 @@ pip install Pygments 1. Windows 环境下,推荐使用最新版TeX Live套件,然后在工程目录下运行以下命令编译: ``` shell - cd book compile.bat ``` -2. MacOS 环境下,推荐使用MacTex套件,然后编译。 +2. MacOS 环境下,推荐使用MacTex套件,然后在工程目录下运行以下命令编译: + + ``` shell + ./compile.sh + ``` -3. Linux 环境下,推荐使用最新版TeX Live套件,然后编译。 +3. Linux 环境下,推荐使用最新版TeX Live套件,然后在工程目录下运行以下命令编译: -由于实验指导书较长,从头开始进行一次编译需要几分钟时间,请耐心等待。 + ``` shell + ./compile.sh + ``` -## 4. 说明 +4. 本文档支持在Overleaf在线编辑环境中编辑,编译前需要将Compiler配置为XeLaTex。 -项目主要结构参考了“Q-book LaTeX书籍模板”的早期版本。 +由于实验指导书较长,从头开始进行一次编译需要几分钟时间,请耐心等待。 diff --git a/compile.bat b/compile.bat index 0e53ac7..778e1b5 100644 --- a/compile.bat +++ b/compile.bat @@ -1,71 +1,11 @@ @echo off -chcp 65001 >nul - -set flag=%1 -if %flag%x == x ( - set flag=instr -) - -if %flag%x == instrx ( - call :cleanall - call :instr - if ERRORLEVEL 1 ( - echo Error! Please check the 'instructions.log' for more details... - pause - ) else ( - call :clean - echo Finished! - ) - goto :EOF -) - -if %flag%x == cleanx ( - call :clean - goto :EOF -) - -if %flag%x == cleanallx ( - call :cleanall - goto :EOF -) - -:help - echo This is the compile batch script for CNAP Instructions. - echo Usage: - echo make.bat [option] - echo options: - echo instr Compile the instructions book (default) - echo clean Clean all work files - echo cleanall Clean all work files and generated pdf - echo help Print this help message -goto :EOF - -:instr - echo Compile... - latexmk -xelatex -shell-escape --halt-on-error -silent instructions >nul 2>nul -goto :EOF - -:clean - echo Clean files... - latexmk -c -silent 2>nul - del instructions.bbl >nul 2>nul - del instructions.listing >nul 2>nul - del instructions.xdv >nul 2>nul - del instructions.run.xml >nul 2>nul - rmdir /S /Q _minted-instructions >nul 2>nul -goto :EOF - -:cleanall - echo Clean files... - latexmk -C -silent 2>nul - del instructions.bbl >nul 2>nul - del instructions.listing >nul 2>nul - del instructions.xdv >nul 2>nul - del instructions.run.xml >nul 2>nul - rmdir /S /Q _minted-instructions >nul 2>nul - if exist instructions.pdf ( - echo Close the file: instructions.pdf! - pause - call :cleanall - ) -goto :EOF +echo Compiling... +latexmk -xelatex -shell-escape --halt-on-error -silent instructions >nul 2>nul +echo Done! + +echo Clean files... +latexmk -c -silent 2>nul +del instructions.listing >nul 2>nul +del instructions.xdv >nul 2>nul +rmdir /S /Q _minted-instructions >nul 2>nul +echo Done! diff --git a/compile.sh b/compile.sh new file mode 100755 index 0000000..317bdda --- /dev/null +++ b/compile.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +echo Compiling... +latexmk -xelatex -shell-escape --halt-on-error -silent instructions > /dev/null 2>&1 +echo Done! + +echo Clean files... +latexmk -c -silent > /dev/null 2>&1 +rm instructions.listing > /dev/null 2>&1 +rm instructions.xdv > /dev/null 2>&1 +rm -r _minted-instructions > /dev/null 2>&1 +echo Done! diff --git a/config/main.tex b/config/main.tex index 8dfa539..367e10f 100644 --- a/config/main.tex +++ b/config/main.tex @@ -21,7 +21,6 @@ % % 使用方正系列字体 % \setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01} -% \setCJKsansfont{FZHei-B01} % \setCJKfamilyfont{zhsong}{FZShuSong-Z01} % \setCJKfamilyfont{zhhei}{FZHei-B01} % \setCJKfamilyfont{zhkai}{FZKai-Z03} @@ -33,6 +32,10 @@ % \renewcommand*{\fangsong}{\CJKfamily{zhfs}} % 仿宋 % \renewcommand*{\lishu}{\CJKfamily{zhli}} % 隶书 +% \setCJKsansfont{FZHei-B01} % 中文无衬线字体 +% \setCJKmonofont{FZHei-B01} % 中文等宽字体 + + %============================================================================ % 配制列表环境 \usepackage{enumitem} @@ -55,7 +58,7 @@ breakable=true, minted language=#1, extras={frame empty}, - fontupper=\small, + fontupper=\linespread{1.3}\small, % minted style=colorful, minted options={ %自动移除前置空白、制表为4字符、mathhe和||内的不处理 fontfamily=tt, diff --git a/data/appendix/cheat_sheet.tex b/data/appendix/cheat_sheet.tex index f31b9c8..aa8c7d5 100644 --- a/data/appendix/cheat_sheet.tex +++ b/data/appendix/cheat_sheet.tex @@ -21,8 +21,6 @@ 各实验如有特殊要求,还在正文中指出了各自的细节评分标准。 \end{itemize} -% \renewcommand{\arraystretch}{1.5} - \begin{table}[!ht] \small \centering @@ -107,18 +105,17 @@ \tabitem{了解开发简单应用程序的流程。} & 4 & $\star\star\star$ \\ \hline - 组网基础 + \multirow{2}{1.5cm}{\centering 组网基础} & 静态路由 & \tabitem{掌握静态路由协议;} \par \tabitem{理解路由器工作原理;} \par \tabitem{掌握路由器相关的配置、检测操作。} - & 2 & $\star$ \\ \hline + & 2 & $\star$ \\ \cline{2-5} - \multirow{2}{1.5cm}{\centering 组网基础} & 动态路由(RIP) & \tabitem{理解动态路由协议RIP的工作原理;} \par \tabitem{掌握采用动态路由协议RIP进行网络设计的基本原则和方法。} - & 2 & $\star\star$ \\ \cline{2-5} + & 2 & $\star\star$ \\ \hline & 动态路由(OSPF) & \tabitem{理解动态路由协议OSPF的工作原理;} \par @@ -157,7 +154,6 @@ \begin{landscape} -% \renewcommand{\arraystretch}{1.5} \small \begin{longtable}{|m{1.5cm}<{\centering} |m{2cm}<{\centering} diff --git a/data/appendix/ensp.tex b/data/appendix/ensp.tex index 907c96c..7ee11fa 100644 --- a/data/appendix/ensp.tex +++ b/data/appendix/ensp.tex @@ -17,7 +17,6 @@ eNSP的正常实验依赖与WinPcap、Wireshark和VirtualBox三款软件, 支持的版本如下表。 -% \renewcommand{\arraystretch}{1.5} \begin{table}[!ht] \small \centering @@ -66,7 +65,6 @@ eNSP的正常实验依赖与WinPcap、Wireshark和VirtualBox三款软件, 系统的所有命令都注册在某个(或某些)命令视图下, 只有在相应的视图下才能执行该视图下的命令。 -% \renewcommand{\arraystretch}{1.5} \begin{table}[!ht] \small \centering @@ -137,7 +135,6 @@ Tab键的功用:完成一个命令的输入。在超级终端中,可能不 \item 命令行错误信息 \end{itemize} -% \renewcommand{\arraystretch}{1.5} \begin{table}[!ht] \small \centering diff --git a/data/appendix/fast.tex b/data/appendix/fast.tex index ea6bb2f..1cd5c3f 100644 --- a/data/appendix/fast.tex +++ b/data/appendix/fast.tex @@ -259,7 +259,7 @@ SDN交换实验的两台测试主机可以随意连接到设备的数据接口 \subsection{FAST开源社区} 由于FAST架构设计的独特优势,用户无需关心平台的分组网络IO、存储和加速方法,只专注于创新架构的设计和核心技术研究,极大的加快网络创新技术的落地与应用。来自全国的近100家的高校、科研院所和设备厂商单位都加入的FAST开源社区。FAST开源社区致力于网络领域的基础网络技术分析与实现,热门网络技术跟踪研究与原型实现和未来网络技术探索与研究。更多的网络前沿技术及FAST的实现方法以及FAST的编程开发方法请关注FAST社区公众号及相关服务网站。 -\begin{figure}[H] +\begin{figure}[ht!] \centering \includegraphics[width=5cm]{fast-w} \caption{FAST公众号} diff --git a/data/ch_ensp/preface.tex b/data/ch_ensp/preface.tex index 3678d82..120c5d8 100644 --- a/data/ch_ensp/preface.tex +++ b/data/ch_ensp/preface.tex @@ -5,7 +5,7 @@ 掌握静态路由、动态路由RIP和OSPF协议的配置,并理解分析静态与动态路由的区别, 两种动态路由协议各自的适用环境,理解网络收敛的概念。 -推荐使用华为ENSP模拟器, -在附录\ref{app:eNSP}:《华为网络仿真平台 ENSP 简介》中有该软件的安装、操作和使用, +推荐使用华为eNSP模拟器, +在附录\ref{app:eNSP}:《华为网络仿真平台 eNSP 简介》中有该软件的安装、操作和使用, 以熟悉华为模拟设备的基本配置及其配置命令, 掌握软件安装常见问题的解决方法。 diff --git a/data/ch_ensp/sec_ospf.tex b/data/ch_ensp/sec_ospf.tex index ba15c27..475baa8 100644 --- a/data/ch_ensp/sec_ospf.tex +++ b/data/ch_ensp/sec_ospf.tex @@ -42,7 +42,7 @@ \label{subsec:c:ensp:s:ospf_requirement} \begin{itemize} - \item 华为ENSP仿真平台中:2台PC,3台路由器; + \item 华为eNSP仿真平台中:2台PC,3台路由器; \item 双绞线若干。 \end{itemize} diff --git a/data/ch_ensp/sec_rip.tex b/data/ch_ensp/sec_rip.tex index 22b699c..d762724 100644 --- a/data/ch_ensp/sec_rip.tex +++ b/data/ch_ensp/sec_rip.tex @@ -40,7 +40,7 @@ \label{subsec:c:ensp:s:rip_requirement} \begin{itemize} - \item 华为ENSP仿真平台中:2台PC,3台路由器; + \item 华为eNSP仿真平台中:2台PC,3台路由器; \item 双绞线若干。 \end{itemize} @@ -124,30 +124,30 @@ \item 为路由器R1的 GE1接口配置IP地址。 \begin{code}[text] [zhangsanR1]interface GigabitEthernet 0/0/1 - [zhangsanR1-GigabitEthernet0/0/1]ip address 192.168.2.1 255.255.255.0 - [zhangsanR1-GigabitEthernet0/0/1]quit -\end{code} -\item 为路由器R2的GE0、GE1接口配置IP地址。 -配置完成后路由器R1和R2应该可以互相Ping通。 -要求记录输入的命令和输出(截屏) + [zhangsanR1-GigabitEthernet0/0/1]ip address 192.168.2.1 255.255.255.0 + [zhangsanR1-GigabitEthernet0/0/1]quit + \end{code} + \item 为路由器R2的GE0、GE1接口配置IP地址。 + 配置完成后路由器R1和R2应该可以互相Ping通。 + 要求记录输入的命令和输出(截屏) \begin{code}[text] [zhangsanR2]interface GigabitEthernet 0/0/0 - [zhangsanR2-GigabitEthernet0/0/0]ip address 192.168.2.2 255.255.255.0 - [zhangsanR2-GigabitEthernet0/0/0]quit -\end{code} + [zhangsanR2-GigabitEthernet0/0/0]ip address 192.168.2.2 255.255.255.0 + [zhangsanR2-GigabitEthernet0/0/0]quit + \end{code} \begin{code}[text] [zhangsanR2]interface GigabitEthernet 0/0/1 - [zhangsanR2-GigabitEthernet0/0/1]ip address 192.168.3.1 255.255.255.0 - [zhangsanR2-GigabitEthernet0/0/1]quit -\end{code} -\item 为路由器R3的GE0、GE1接口配置IP地址。配置完成后, -直连路由应可相互Ping通,如PC2应可Ping通R3的GE1口的地址。 + [zhangsanR2-GigabitEthernet0/0/1]ip address 192.168.3.1 255.255.255.0 + [zhangsanR2-GigabitEthernet0/0/1]quit + \end{code} + \item 为路由器R3的GE0、GE1接口配置IP地址。配置完成后, + 直连路由应可相互Ping通,如PC2应可Ping通R3的GE1口的地址。 \begin{code}[text] [zhangsanR3]interface GigabitEthernet 0/0/0 - [zhangsanR3-GigabitEthernet0/0/0]ip address 192.168.3.2 255.255.255.0 - [zhangsanR3-GigabitEthernet0/0/0]quit -\end{code} + [zhangsanR3-GigabitEthernet0/0/0]ip address 192.168.3.2 255.255.255.0 + [zhangsanR3-GigabitEthernet0/0/0]quit + \end{code} \begin{code}[text] [zhangsanR3]interface GigabitEthernet 0/0/1 diff --git a/data/ch_ensp/sec_static.tex b/data/ch_ensp/sec_static.tex index 985d1e3..90db957 100644 --- a/data/ch_ensp/sec_static.tex +++ b/data/ch_ensp/sec_static.tex @@ -13,7 +13,7 @@ \begin{itemize} \item 华为网络设备常用配置命令; - \item 华为网络模拟器ENSP的安装; + \item 华为网络模拟器eNSP的安装; \item IP地址的配置; \item 静态路由的配置; \item 路由规划; @@ -43,7 +43,7 @@ \label{subsec:c:ensp:s:static_requirement} \begin{itemize} - \item 华为ENSP仿真平台中:2台PC,三台路由器; + \item 华为eNSP仿真平台中:2台PC,三台路由器; \item 双绞线若干。 \end{itemize} diff --git a/data/ch_sdn-openbox/sec_sdn.tex b/data/ch_sdn-openbox/sec_sdn.tex index e692e7f..9146482 100644 --- a/data/ch_sdn-openbox/sec_sdn.tex +++ b/data/ch_sdn-openbox/sec_sdn.tex @@ -163,7 +163,7 @@ SDN将传统的紧耦合网络设备拆分成了应用、控制和转发三层 \end{code} \item 查看控制器界面基本信息,在浏览器打开控制器WEB网站http://192.168.1.3/ui/index.html,控制界面如图\ref{fig:c:sdn-ob_sdn-main}所示: - \begin{figure}[H] + \begin{figure}[ht!] \centering \includegraphics[width=12cm]{sdn-main} \caption{SDN主界面信息} @@ -171,7 +171,7 @@ SDN将传统的紧耦合网络设备拆分成了应用、控制和转发三层 \end{figure} \item 查看连接交换机信息,如图\ref{fig:c:sdn-ob_sdn-switch}所示: - \begin{figure}[H] + \begin{figure}[ht!] \centering \includegraphics[width=12cm]{sdn-switch} \caption{SDN交换机信息} @@ -179,7 +179,7 @@ SDN将传统的紧耦合网络设备拆分成了应用、控制和转发三层 \end{figure} \item 查看连接测试主机信息,SDN主机及连接信息如图\ref{fig:c:sdn-ob_sdn-host}所示: - \begin{figure}[H] + \begin{figure}[ht!] \centering \includegraphics[width=12cm]{sdn-host} \caption{SDN主机信息} @@ -187,7 +187,7 @@ SDN将传统的紧耦合网络设备拆分成了应用、控制和转发三层 \end{figure} \item 查看端口状态与计数信息与流表信息,端口与流表信息如图\ref{fig:c:sdn-ob_port-flowtable}所示: - \begin{figure}[H] + \begin{figure}[ht!] \centering \includegraphics[width=12cm]{port-flowtable} \caption{端口状态与流表计数信息} @@ -195,7 +195,7 @@ SDN将传统的紧耦合网络设备拆分成了应用、控制和转发三层 \end{figure} \item 查看网络拓扑信息,网络拓扑信息如图\ref{fig:c:sdn-ob_sdn-test-topo}所示: - \begin{figure}[H] + \begin{figure}[ht!] \centering \includegraphics[width=12cm]{sdn-test-topo} \caption{SDN网络拓扑信息} @@ -206,7 +206,7 @@ SDN将传统的紧耦合网络设备拆分成了应用、控制和转发三层 \subsubsection{在测试主机ping的前后,分别观察流表变化;} \begin{enumerate} \item ping之前的流表信息为空,如图\ref{fig:c:sdn-ob_empty-flowtable}所示: - \begin{figure}[H] + \begin{figure}[ht!] \centering \includegraphics[width=12cm]{empty-flowtable} \caption{空流表信息} @@ -214,7 +214,7 @@ SDN将传统的紧耦合网络设备拆分成了应用、控制和转发三层 \end{figure} \item ping之后的流表信息,如图\ref{fig:c:sdn-ob_flowtable-ping}所示: - \begin{figure}[H] + \begin{figure}[ht!] \centering \includegraphics[width=12cm]{flowtable-ping} \caption{ping通后流表信息} diff --git a/data/ch_sdn-openbox/sec_topo.tex b/data/ch_sdn-openbox/sec_topo.tex index 8b5d4ad..940cc69 100644 --- a/data/ch_sdn-openbox/sec_topo.tex +++ b/data/ch_sdn-openbox/sec_topo.tex @@ -61,6 +61,13 @@ SDN交换机使用LLDP链路探测协议主要是通过PACKET\_OUT消息发送LL 交换机之间的链路信息加上交换机与主机之间的链路信息就完整的构成了全网的拓扑连接关系。 \end{enumerate} +\begin{figure}[h!] + \centering + \includegraphics[width=10cm]{openflow-topo} + \caption{OpenFlow拓扑测量实验拓扑图} + \label{fig:c:sdn-ob_openflow-topo} +\end{figure} + \subsection{实验条件} \label{subsec:c:sdn-ob:s:topo_requirement} @@ -71,13 +78,6 @@ SDN交换机使用LLDP链路探测协议主要是通过PACKET\_OUT消息发送LL \item SDN交换机框架源码。 \end{itemize} -\begin{figure}[H] - \centering - \includegraphics[width=10cm]{openflow-topo} - \caption{OpenFlow拓扑测量实验拓扑图} - \label{fig:c:sdn-ob_openflow-topo} -\end{figure} - \subsection{实验步骤} \label{subsec:c:sdn-ob:s:topo_procedure} @@ -122,8 +122,10 @@ SDN交换机使用LLDP链路探测协议主要是通过PACKET\_OUT消息发送LL \item 断开一台测试主机,刷新拓扑界面,查看其对应的主机从界面消失。 \end{enumerate} \item 使用控制器的北向REST API接口查询网络的所有链路连接关系数据, + API接口为:\texttt{/wm/topology/links/json}; \item 使用控制器的北向REST API接口查询全网所有设备节点信息, + API接口为:\texttt{/wm/device/}; \item 自己开发网络拓扑展示效果图; \item 修改网络拓扑后验证自己开发程序的效果。 diff --git a/data/ch_wireshark/sec_arp.tex b/data/ch_wireshark/sec_arp.tex index 25d56ea..6b062c0 100644 --- a/data/ch_wireshark/sec_arp.tex +++ b/data/ch_wireshark/sec_arp.tex @@ -55,7 +55,6 @@ Wireshark可以在Windows、Linux和macOS操作系统中运行, 它由IEEE分配; 而后3个字节的16进制数AE-3C-40代表该制造商所生产的某个网络产品(如网卡)的系列号。 -% \renewcommand{\arraystretch}{1.5} \begin{table}[!ht] \small \centering @@ -241,19 +240,6 @@ IP地址长度为4字节。每个字段的含义如下: \label{fig:c:wireshark_eth-frame-detail} \end{figure} -\subsubsection{差错检测,FCS计算检验} -计算以太网帧的尾部校验和,并与Wireshark显示数值进行比较验证。 -\subsubsection{ARP协议分析} -\begin{enumerate} - \item 使用\texttt{arp –d}命令(其语法见图\ref{fig:arp-cmd}), - 清空本机已有的ARP缓存, - 开启Wireshark,ping本机的同网段地址,在显示过滤器条框中输入“\texttt{arp}”, - 观察捕获的ARP报文的各个字段,分析请求/响应的过程。 - \item 使用\texttt{arp –d}命令,清空本机已有的ARP缓存。开启Wireshark, - ping本机的不同网段地址或域名,观察捕获的ARP报文的各个字段, - 分析请求/响应的过程。 -\end{enumerate} - \begin{figure}[!ht] \centering \begin{code}[text] @@ -269,6 +255,19 @@ IP地址长度为4字节。每个字段的含义如下: \label{fig:arp-cmd} \end{figure} +\subsubsection{差错检测,FCS计算检验} +计算以太网帧的尾部校验和,并与Wireshark显示数值进行比较验证。 +\subsubsection{ARP协议分析} +\begin{enumerate} + \item 使用\texttt{arp –d}命令(其语法见图\ref{fig:arp-cmd}), + 清空本机已有的ARP缓存, + 开启Wireshark,ping本机的同网段地址,在显示过滤器条框中输入“\texttt{arp}”, + 观察捕获的ARP报文的各个字段,分析请求/响应的过程。 + \item 使用\texttt{arp –d}命令,清空本机已有的ARP缓存。开启Wireshark, + ping本机的不同网段地址或域名,观察捕获的ARP报文的各个字段, + 分析请求/响应的过程。 +\end{enumerate} + \subsection{思考题} \label{subsec:c:wireshark:s:arp_rethink} diff --git a/data/ch_wireshark/sec_ip.tex b/data/ch_wireshark/sec_ip.tex index 2247c87..d304c87 100644 --- a/data/ch_wireshark/sec_ip.tex +++ b/data/ch_wireshark/sec_ip.tex @@ -118,7 +118,6 @@ ICMP询问报文有回送请求和应答、时间戳请求和应答、 \label{c:wireshark_icmp-structure} \end{figure} -% \renewcommand{\arraystretch}{1.5} \begin{table}[!ht] \small \centering diff --git a/data/ch_wireshark/sec_tcp.tex b/data/ch_wireshark/sec_tcp.tex index cf5b75b..252c612 100644 --- a/data/ch_wireshark/sec_tcp.tex +++ b/data/ch_wireshark/sec_tcp.tex @@ -220,7 +220,6 @@ BBR\footnote{\href{https://queue.acm.org/detail.cfm?id=3022184}{BBR: Congestion- \label{fig:c:wireshark_VM-advance-setup} \end{figure} -% \renewcommand{\arraystretch}{1.5} \begin{table}[!ht] \small \centering diff --git a/figure/chapters/wireshark/arp-format.pdf b/figure/chapters/wireshark/arp-format.pdf new file mode 100644 index 0000000..dd9b4e8 Binary files /dev/null and b/figure/chapters/wireshark/arp-format.pdf differ diff --git a/figure/chapters/wireshark/arp-format.png b/figure/chapters/wireshark/arp-format.png deleted file mode 100644 index fde08c0..0000000 Binary files a/figure/chapters/wireshark/arp-format.png and /dev/null differ