diff --git a/README.md b/README.md index 72c18e8..7324fc7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,19 @@ # OpenNetLab Doc +## overview + documentation for OpenNetLab for Education 2022 see [doc site](https://OpenNetLab.github.io/OpenNetLab-Edu-Doc) for more details + +## site generation + +``` +# install the required build modules +pip3 install sphinx --user +pip3 install sphinx_rtd_theme --user +pip3 install myst-parser --user + +# make +make html +``` diff --git a/conf.py b/conf.py index ebdb1b3..05f07ba 100644 --- a/conf.py +++ b/conf.py @@ -18,11 +18,11 @@ # -- Project information ----------------------------------------------------- project = 'OpenNetLab-Edu-2022' -copyright = '2022, zdszero' -author = 'zdszero' +copyright = '2022, OpenNetLab' +author = 'OpenNetLab' # The full version, including alpha/beta/rc tags -release = '0.2' +release = '1.0' # -- General configuration --------------------------------------------------- diff --git a/docs/doctrees/OpenNetLab.doctree b/docs/doctrees/OpenNetLab.doctree index b47b71e..69d3f7f 100644 Binary files a/docs/doctrees/OpenNetLab.doctree and b/docs/doctrees/OpenNetLab.doctree differ diff --git a/docs/doctrees/OpenNetLab.node.doctree b/docs/doctrees/OpenNetLab.node.doctree index 38b8f63..eebe761 100644 Binary files a/docs/doctrees/OpenNetLab.node.doctree and b/docs/doctrees/OpenNetLab.node.doctree differ diff --git a/docs/doctrees/OpenNetLab.protocol.doctree b/docs/doctrees/OpenNetLab.protocol.doctree index 3f6e3f0..76cccf1 100644 Binary files a/docs/doctrees/OpenNetLab.protocol.doctree and b/docs/doctrees/OpenNetLab.protocol.doctree differ diff --git a/docs/doctrees/OpenNetLab.utils.doctree b/docs/doctrees/OpenNetLab.utils.doctree index cb0e64b..b5b9ea3 100644 Binary files a/docs/doctrees/OpenNetLab.utils.doctree and b/docs/doctrees/OpenNetLab.utils.doctree differ diff --git a/docs/doctrees/README.doctree b/docs/doctrees/README.doctree index 7c7c5dc..ce54c40 100644 Binary files a/docs/doctrees/README.doctree and b/docs/doctrees/README.doctree differ diff --git a/docs/doctrees/environment.pickle b/docs/doctrees/environment.pickle index fb7c1fb..65315a9 100644 Binary files a/docs/doctrees/environment.pickle and b/docs/doctrees/environment.pickle differ diff --git a/docs/doctrees/index.doctree b/docs/doctrees/index.doctree index bf2de2b..75c696e 100644 Binary files a/docs/doctrees/index.doctree and b/docs/doctrees/index.doctree differ diff --git a/docs/doctrees/lab-manuals/dns_server.doctree b/docs/doctrees/lab-manuals/dns_server.doctree new file mode 100644 index 0000000..c80e7b4 Binary files /dev/null and b/docs/doctrees/lab-manuals/dns_server.doctree differ diff --git a/docs/doctrees/lab-manuals/gbn_sender.doctree b/docs/doctrees/lab-manuals/gbn_sender.doctree new file mode 100644 index 0000000..855f076 Binary files /dev/null and b/docs/doctrees/lab-manuals/gbn_sender.doctree differ diff --git a/docs/doctrees/lab-manuals/sr_sender.doctree b/docs/doctrees/lab-manuals/sr_sender.doctree new file mode 100644 index 0000000..0acd8ff Binary files /dev/null and b/docs/doctrees/lab-manuals/sr_sender.doctree differ diff --git a/docs/doctrees/modules.doctree b/docs/doctrees/modules.doctree index 1dc9ccb..44ca454 100644 Binary files a/docs/doctrees/modules.doctree and b/docs/doctrees/modules.doctree differ diff --git a/docs/doctrees/onl-doc/Developer.doctree b/docs/doctrees/onl-doc/Developer.doctree index 038d05f..9c3db18 100644 Binary files a/docs/doctrees/onl-doc/Developer.doctree and b/docs/doctrees/onl-doc/Developer.doctree differ diff --git a/docs/doctrees/onl-doc/System.doctree b/docs/doctrees/onl-doc/System.doctree index 0c35421..b8d872b 100644 Binary files a/docs/doctrees/onl-doc/System.doctree and b/docs/doctrees/onl-doc/System.doctree differ diff --git a/docs/doctrees/onl-doc/Teacher.doctree b/docs/doctrees/onl-doc/Teacher.doctree index 1aeb258..ee33641 100644 Binary files a/docs/doctrees/onl-doc/Teacher.doctree and b/docs/doctrees/onl-doc/Teacher.doctree differ diff --git a/docs/doctrees/onl-doc/User.doctree b/docs/doctrees/onl-doc/User.doctree index 4ea46a9..62f9b7d 100644 Binary files a/docs/doctrees/onl-doc/User.doctree and b/docs/doctrees/onl-doc/User.doctree differ diff --git a/docs/doctrees/onl-doc/UserGuide.doctree b/docs/doctrees/onl-doc/UserGuide.doctree index 3d607f8..342001e 100644 Binary files a/docs/doctrees/onl-doc/UserGuide.doctree and b/docs/doctrees/onl-doc/UserGuide.doctree differ diff --git a/docs/html/.buildinfo b/docs/html/.buildinfo index 327cebe..6fde9a7 100644 --- a/docs/html/.buildinfo +++ b/docs/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 6e006d153d030098b15df0a7e4a7c09c +config: 7906e0535580c730fc07d3c998b668f8 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/html/OpenNetLab.html b/docs/html/OpenNetLab.html index bbef0c3..2a9371f 100644 --- a/docs/html/OpenNetLab.html +++ b/docs/html/OpenNetLab.html @@ -4,7 +4,7 @@ - OpenNetLab package — OpenNetLab-Edu-2022 0.2 documentation + OpenNetLab package — OpenNetLab-Edu-2022 1.0 documentation + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

DNS Server Lab

+
+

Overview

+

在这个实验中,你的任务是实现一个搭建在OpenNetLab上的DNS服务器,该服务器具备拦截特定域名,以及返回域名对应IP的功能。

+
+
+

Getting Started

+
    +
  1. 下载实验资源 ,解压后进入dns_server文件夹,其中包含两个子文件夹,resource文件夹中包含完成该实现所需阅读的文档以及实验报告模板,code文件夹中包含基础的实验代码模板。

  2. +
  3. 阅读实验任务,完成代码模板中 TODO 部分的代码片段。

  4. +
  5. 进行本地测试,完成本地测试后将代码提交到在线平台进行远程评测。

  6. +
+
+
+

Tasks

+
    +
  1. 处理DNS请求

  2. +
+

从配置文件 example.txt 中读取 domain name — IP address 的映射,并且按照如下规则处理DNS请求:

+
    +
  • Intercept:如果请求的DNS域名在配置文件的映射中并且对应的IP为 0.0.0.0 ,对该域名进行拦截,返回一个错误DNS应答给客户端

  • +
  • Local Resolve:如果请求的DNS域名在配置文件的映射中并且对应的IP是合法的,返回对应IP地址给客户端

  • +
  • Relay:如果请求的DNS域名不在配置文件,将对应的DNS请求转发给公网上的DNS服务器,当收到该服务器的应答时,将应答转发给客户端

  • +
+
    +
  1. 对DNS请求、应答数据包进行编码

  2. +
+

阅读rfc 1035,理解DNS请求和应答中各个字段的含义,并且在代码中完成对于DNS数据包的编码

+
+
+

Testing

+
    +
  1. 进行本地测试

  2. +
+

在本机运行 dns_serverdns_client 程序,其中 dns_client 作为评测端,会使用本地的测试用例对DNS服务器的正确性进行评测。

+
python3 dns_server.py -l localhost:9001 -r localhost:9000
+python3 dns_client.py -l localhost:9000 -r localhost:9001
+
+
+
    +
  1. 提交代码进行远程评测

  2. +
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/html/lab-manuals/gbn_sender.html b/docs/html/lab-manuals/gbn_sender.html new file mode 100644 index 0000000..460f339 --- /dev/null +++ b/docs/html/lab-manuals/gbn_sender.html @@ -0,0 +1,185 @@ + + + + + + + GBN Sender Lab — OpenNetLab-Edu-2022 1.0 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

GBN Sender Lab

+
+

Overview

+

Go-Back-N是自动重复请求(ARQ)协议的一个特定实例,在该协议中,即使没有收到来自接收方的确认(ACK)包,发送过程也会继续发送由窗口大小指定的帧数。它是一般滑动窗口协议的一种特殊情况,发送窗口大小为N,接收窗口大小为1。当收到接收方的确认时,发送方将窗口向后移动,并且发送其他可以发送的帧。

+

在这个实验中,你的任务是实现一个搭建在OpenNetLab上的使用GBN协议的发送端,

+
+
+

Gettting Started

+
    +
  1. 下载实验资源 ,解压后进入gbn_sender文件夹,其中包含两个子文件夹,resource文件夹中包含完成该实现所需阅读的文档以及实验报告模板,code文件夹中包含基础的实验代码模板。

  2. +
  3. 阅读实验任务,完成代码模板中 TODO 部分的代码片段。

  4. +
  5. 进行本地测试,完成本地测试后将代码提交到在线平台进行远程评测。

  6. +
+
+
+

Tasks

+

在这个实验中,你需要将一个字符串中的每个字符封装为帧发送给接收方,并且遵循GBN协议:

+
    +
  • 开始时发送滑动窗口内所有可以发送的帧。

  • +
  • 每发送一个帧时,保存该帧在缓冲区中。

  • +
  • 缓冲区对应一个定时器,当定时器超时的时候,重新发送缓冲区中的所有帧。

  • +
  • 当收到接收方的确认后,判断该确认是否合法。如果不合法的话,什么也不做;如果合法的话,移动滑动窗口,将已经被确认的帧从缓冲区中删除,并且发送接下来可以发送的帧,重置定时器。

  • +
+

你可以通过 GBN交互演示 来帮助自己更好地理解GBN的过程。

+

该实验的伪代码如下:

+
N: sending window size
+
+function send_message() {
+    create timer, bind timer to function timeout_handler
+    create buffer with size N
+
+    send available packets, add these packets to buffer
+    while (True) {
+        receive Packet from GBN receiver as p
+        if p['ackno'] is valid ackno {
+            remove acked packets from buffer
+            send the following available packets
+        }
+        reset timer
+        if all packets are sent and acked {
+            break
+        }
+    }
+}
+
+function timeout_handler() {
+    resend all the packets in buffer
+    reset timer
+}
+
+
+
+
+

Testing

+
    +
  1. 进行本地测试

  2. +
+

在本机运行 gbn_sendergbn_receiver 程序,其中 gbn_receiver 作为评测端,会使用本地的测试用例对GBN发送端的正确性进行评测。

+
python3 gbn_receiver.py -l localhost:9001 -r localhost:9000
+python3 gbn_sender.py -l localhost:9000 -r localhost:9001
+
+
+
    +
  1. 提交代码进行远程评测

  2. +
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/html/lab-manuals/sr_sender.html b/docs/html/lab-manuals/sr_sender.html new file mode 100644 index 0000000..c3d1e9f --- /dev/null +++ b/docs/html/lab-manuals/sr_sender.html @@ -0,0 +1,184 @@ + + + + + + + SR Sender Lab — OpenNetLab-Edu-2022 1.0 documentation + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

SR Sender Lab

+
+

Overview

+

选择性重传(Selective Repeat)是自动重复请求(ARQ)的一部分。使用选择性重复,发送方发送由窗口大小指定的帧数,甚至不需要像Go-Back-N ARQ中那样等待接收方的单个ACK。接收端可以选择性地拒绝单个帧,该帧可以单独重传;这与其他形式的ARQ形成了鲜明的对比,后者必须从那个点再次发送每一帧。在选择性重传协议中,接收端接收乱序帧并缓冲它们,发送方分别重新传输已经超时的帧。

+

在这个实验中,你的任务是实现一个搭建在OpenNetLab上的使用SR协议的发送端,

+
+
+

Gettting Started

+
    +
  1. 下载实验资源 ,解压后进入sr_sender文件夹,其中包含两个子文件夹,resource文件夹中包含完成该实现所需阅读的文档以及实验报告模板,code文件夹中包含基础的实验代码模板。

  2. +
  3. 阅读实验任务,完成代码模板中 TODO 部分的代码片段。

  4. +
  5. 进行本地测试,完成本地测试后将代码提交到在线平台进行远程评测。

  6. +
+
+
+

Tasks

+

在这个实验中,你需要将一个字符串中的每个字符封装为帧发送给接收方,并且遵循SR协议:

+
    +
  • 开始时发送滑动窗口内所有可以发送的帧。

  • +
  • 每发送一个帧时,保存该帧在缓冲区中。

  • +
  • 每个缓冲区内的帧对应一个定时器,当定时器超时的时候,重新发送对应的帧。

  • +
  • 当收到接收方的确认后,判断该确认是否合法。如果不合法的话,什么也不做;如果合法的话,将对应缓冲区中的帧标记为被确认,如果被确认的帧位于滑动窗口头部,移动滑动窗口直到头部的帧未被确认,并且发送接下来可以发送的帧。

  • +
+

你可以通过 SR交互演示 来帮助自己更好地理解SR的过程。

+

该实验的伪代码如下:

+
N: sending window size
+
+function send_message() {
+    create buffer with size N
+
+    send available packets, add these packets to buffer
+    while (True) {
+        receive Packet from SR receiver as p
+        if p['ackno'] is valid ackno {
+            mark the corresponding packet in buffer as acked
+            if (the head of buffer is acked) {
+                send the next packet to receiver
+                bind timer to the sent packet
+            }
+        }
+        if all packets are sent and acked {
+            break
+        }
+    }
+}
+
+function timeout_handler() {
+    resend the corresponding packet
+    reset timer
+}
+
+
+
+
+

Testing

+
    +
  1. 进行本地测试

  2. +
+

在本机运行 sr_sendersr_receiver 程序,其中 sr_receiver 作为评测端,会使用本地的测试用例对SR发送端的正确性进行评测。

+
python3 sr_receiver.py -l localhost:9001 -r localhost:9000
+python3 sr_sender.py -l localhost:9000 -r localhost:9001
+
+
+
    +
  1. 提交代码进行远程评测

  2. +
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/html/modules.html b/docs/html/modules.html index 5c41319..c26e4ed 100644 --- a/docs/html/modules.html +++ b/docs/html/modules.html @@ -4,7 +4,7 @@ - OpenNetLab — OpenNetLab-Edu-2022 0.2 documentation + OpenNetLab — OpenNetLab-Edu-2022 1.0 documentation