CS144(2023 Spring)Lab 0:networking warmup(环境搭建 & webget & bytestream)

前言

最近心情非常郁闷,搓一个CS144玩玩吧,正好2023 spring出新版了。。。CS144的头4个Lab(加上0是5个),一步步实现了一个TCP。在开始之前,我想贴一下Lab中的这句话:The lab documents aren’t “specifications”—meaning they’re not intended to be consumed in a one-way fashion. They’re written closer to the level of detail that a software
engineer will get from a boss or client.

这句话是说这个Lab的文档并不那么标准化,它看起来更像你的leader给你的需求文档,这话什么意思呢,这里我就不解释了,相信大家跟着这个Lab从头到尾做一遍就会有体会了(笑
在这里插入图片描述

其他笔记

Lab 0: networking warmup
Lab 1: stitching substrings into a byte stream

相关链接

课程主页
lab 0

1. Set up GNU/Linux on your computer

在这里插入图片描述
官方推荐环境有vbox镜像、谷歌云,以及原生Ubuntu安装,我本来想下他那个镜像的就懒得配了,结果一看3G大,挂上魔法都只有100kb的龟速。。。还是用我的WSL吧,Ubuntu版本要求22.10,g++要求12.2

命令行运行它这一串就行了

sudo apt update && sudo apt install git cmake gdb build-essential clang \
clang-tidy clang-format gcc-doc pkg-config glibc-doc tcpdump tshark

这里点是
在这里插入图片描述
安装速度比下载镜像不知道高到哪里去了(21min是因为我挂着等截图,实际估计一两分钟)(
在这里插入图片描述
由于lab要求使用gcc12,而Ubuntu20的官方源没有gcc12,我选择将Ubuntu20直接更新到22,但是强烈不推荐,因为众所周知的原因,我在更新系统的途中耗时极多。。如图,花了得有几个小时。。建议去微软商店里面直接下载新的22。
在这里插入图片描述
安装好gcc12后,可以如图指定gcc各版本优先级以指定默认版本。
在这里插入图片描述

2. Networking by hand

这一节主要是叫你手动搭建网络感受一下里面的过程,头俩没啥好说的,2.3 Listening and connecting的比较有意思,是叫搭建一个双工通信:
首先我们在终端里跑一下netcat -v -l -p 9090
在这里插入图片描述
然后新开一个终端,在里面运行telnet localhost 9090
在这里插入图片描述
可以看到它建立了连接,这个时候我们回到刚才的终端,发现更新了:
在这里插入图片描述
我们随便输入一点东西,并切到隔壁去,会发现隔壁也能收到并显示:
在这里插入图片描述
在这里插入图片描述
这个操作在两边都能完成,可以看出我们建立了双工通信。

3. Writing a network program using an OS stream socket

Task3是叫用socket简单写一个网络编程。值得一提的是,Lab鼓励我们用上Modern C++,从代码上来看,Lab自己至少使用了C++20的内容,而我也会尽可能展示C++20乃至C++23的实现()
在这里插入图片描述

3.1 Linux配置

这一步我们先在linux里拉取仓库代码后编译,不过这个项目要求cmake 3.24.2以上 = =,我的是3.22.1,汗。。。又要更新,我直接更新到了3.27.0。
在这里插入图片描述
跟着流程走一遍编译:

git clone https://github.com/cs144/minnow
cd minnow
cmake -S . -B build
cmake --build build

发现报了俩错
在这里插入图片描述
把报错贴出来方便后来人搜索:

error: invalid return type ‘std::string’ {aka ‘std::__cxx11::basic_string’} of ‘constexpr’ function ‘static constexpr std::string ExpectationViolation::boolstr(bool)’
16 | static constexpr std::string boolstr( bool b ) { return b ? “true” : “false”; }
| ^~~~~~~

看一下报错说的是string不为constexpr类型,我记得constexpr string好像是C++20的内容,这里用的C++11,明显是编译器环境没整对,一查g++ -v,发现果然之前搞了gcc的默认忘改g++了,同样的操作软链接一下:
在这里插入图片描述
再跑一下编译,很成功:
在这里插入图片描述
然后我们还是把他推到我们现有的库里

git remote rm origin                 # 删除当前远程库
git remote add origin  + 远程仓库地址  # 连接到现有的自己的库
git branch -M main
git push -u origin main

然后在vs里导入这个仓库,不演示了。拿到手上先把构建项目的文件给加进gitignore里面:
在这里插入图片描述
我的工具链一般是VS上编辑完后,git到远程,然后wsl上拉取后编译运行。如果需要调试,就直接在VS上打断点在VS上运行调试,这个Lab有CMake,方便得多。

3.2 C++规范

在这里插入图片描述
在开始之前,我们来看一下他提到的一些规范要求:

  • 禁用动态内存分配(malloc&free、new&delete)
  • 禁用裸指针、如果要用指针就用智能指针,不过看提示说CS144不太用得到指针
  • 避免模板、线程、锁、虚函数,说CS144用不到这些
  • 避免使用C风格字符串和C的那一套str-函数,用std::string代替
  • 避免使用C风格cast,用static_cast代替,不过CS144一般用不到
  • 尽量使用const引用传参
  • 函数和变量能用const修饰则用const修饰
  • 避免使用全局变量,把变量限定在尽可能小的作用域里
  • 使用cmake --build build --target tidy获取代码建议,cmake --build build --target format去格式化

这几条都是比较常规的规范,没啥值得注意的。
在这里插入图片描述

然后他说Lab用类封装了各种各样的system function,并且叫你读一下socket.hhfile_descriptor.hh的公共接口,看它的描述,Socket是一种文件描述符,而TCPSocket是一种Socket。我们可以借助他的这个文档看,实际看实现就是逐层继承的关系。
继承关系
看一下接口,都是很常规的socket API,值得注意的一点是今年这里面有的API和往年的不一样!所以还是要以源码为准:
在这里插入图片描述

3.3 Writing webget

3.3.1 实现

终于要开始写代码了,在/apps/webget.cc里面写
在这里插入图片描述
首先实现这个getURL
在这里插入图片描述
其中注意发请求的时候要用\r\n,单纯\n是不够的,此外今年的FileDescriptor::read由直接返回读取的数据改成了传个string引用进去,我分析这么改的原因是为了与新的FileDescriptor::read( vector<unique_ptr<string>>& buffers )这个写入多值的函数形成API形式上的统一吧,不过这写着就丑陋一些了。

void get_URL( const string& host, const string& path )
{
  TCPSocket sock;
  sock.connect( Address( host, "http" ) );
  sock.write("GET " + path + " HTTP/1.1\r\n"    // 请求行
             "Host: " + host + "\r\n"           // 告知服务器主机名
             "Connection: close\r\n"            // 通知服务器关闭连接
             "\r\n");                           // 空行
  sock.shutdown( SHUT_WR ); // 关闭写端

  while ( !sock.eof() ) {   // 读取所有数据
    string tmp;
    sock.read( tmp );
    cout << tmp;
  }
  sock.close();
}

3.3.2 测试

我们在build文件夹下

make
./apps/webget cs144.keithw.org /hello

在这里插入图片描述
可以看到成功返回并打印了一些信息!
接着继续在build下面跑make check_webget测试一下,这一步我最早出现了很奇葩的问题:
在这里插入图片描述
我把错误抠出来方便后来人搜索:

Test project /home/jmc/CS144/minnow/build
    Start 1: compile with bug-checkers
1/2 Test #1: compile with bug-checkers ........***Timeout  12.05 sec
[  6%] Built target minnow_debug
[ 18%] Built target util_sanitized
[ 25%] Built target minnow_sanitized
[ 29%] Built target minnow_testing_sanitized
[ 34%] Built target minnow_testing_debug
[ 45%] Built target util_debug
[ 47%] Building CXX object tests/CMakeFiles/byte_stream_capacity_sanitized.dir/byte_stream_capacity.cc.o
[ 50%] Linking CXX executable byte_stream_basics_sanitized
[ 52%] Building CXX object tests/CMakeFiles/byte_stream_two_writes_sanitized.dir/byte_stream_two_writes.cc.o
[ 54%] Building CXX object tests/CMakeFiles/byte_stream_one_write_sanitized.dir/byte_stream_one_write.cc.o
[ 59%] Building CXX object tests/CMakeFiles/byte_stream_stress_test_sanitized.dir/byte_stream_stress_test.cc.o
[ 59%] Building CXX object tests/CMakeFiles/byte_stream_many_writes_sanitized.dir/byte_stream_many_writes.cc.o
[ 61%] Building CXX object tests/CMakeFiles/byte_stream_stress_test.dir/byte_stream_stress_test.cc.o
[ 63%] Linking CXX executable byte_stream_basics
[ 65%] Built target byte_stream_basics_sanitized
[ 68%] Built target byte_stream_basics
[ 70%] Linking CXX executable byte_stream_capacity
[ 72%] Linking CXX executable byte_stream_one_write
[ 75%] Built target byte_stream_one_write
[ 77%] Linking CXX executable byte_stream_two_writes
[ 79%] Built target byte_stream_capacity
[ 81%] Linking CXX executable byte_stream_many_writes
[ 84%] Linking CXX executable byte_stream_stress_test
[ 86%] Linking CXX executable byte_stream_capacity_sanitized
[ 88%] Linking CXX executable byte_stream_many_writes_sanitized
[ 90%] Linking CXX executable byte_stream_two_writes_sanitized
[ 93%] Linking CXX executable byte_stream_stress_test_sanitized

    Start 2: t_webget
Failed test dependencies: compile with bug-checkers
2/2 Test #2: t_webget .........................***Not Run   0.00 sec

0% tests passed, 2 tests failed out of 2

Total Test time (real) =  12.06 sec

The following tests FAILED:
          1 - compile with bug-checkers (Timeout)
          2 - t_webget (Not Run)
Errors while running CTest
make[3]: *** [CMakeFiles/check_webget.dir/build.make:70:CMakeFiles/check_webget] 错误 8
make[2]: *** [CMakeFiles/Makefile2:1822:CMakeFiles/check_webget.dir/all] 错误 2
make[1]: *** [CMakeFiles/Makefile2:1829:CMakeFiles/check_webget.dir/rule] 错误 2
make: *** [Makefile:914:check_webget] 错误 2

研究半天,这个应该是性能问题,虚拟机性能不好,所以跑半天超时了,解决方法是多跑几遍,或者直接去etc/tests.cmake下面把超时时间改多一点,后面的也是同理:
在这里插入图片描述

在这里插入图片描述

4. An in-memory reliable byte stream

4.1 思路分析

这个task就是叫我们抽象出一个数据结构,可以在一边读一边写,同时用一个capacity限制一下缓冲区的大小,这本质是一个队列的抽象。今年的这个task相比往年的再抽象了一层专用于读与写的子类,比较有意思。

我们先分析一下这个框架,很显然,我们的底层需要维护一个什么数据结构,然后还有几个显然是标志位的东西,我们直接维护一个flg然后置位即可。
在这里插入图片描述

这个ByteStream的设计是有点类似于C++里基于流的IO的,和stringstream的功能差不多,都是实现基于char的流,不过bs和ss不同的是bs是FILO的,而ss是FIFO的,换言之我们的bs在这里像一个“滑动窗口”——-而且左右指针都始终向一个方向前进,这意味着如果我们像ss一样利用string这种简单的连续内存空间来维护我们的数据的话,将会造成左侧内存的浪费——写指针永远无法到达它以前到过的地方,因为它是单向运动的,此外它还无法实现完美转发,因为我们使用operator+=衔接串的话势必需要一次拷贝。

那么queue<char>如何呢?看起来它完美地实现了我们的需求:它是天然的FIFO数据结构,但是还是那个问题——它无法实现完美转发,我们在声明中就可以看到,push接受的参数是一个string值,而我们将string拆成char的这个过程势必涉及到拷贝,它是一个 O ( n ) O(n) O(n)的操作——这甚至还没有考虑零碎空间造成的开销。

那如果考虑完美转发呢?push收到的是连续空间,我们就直接完美转发就行了。这意味着我们需要维护一片一片的连续内存,很容易想到,我们需要维护一个queue<string>,对于每个收到的字符串,我们直接转发进这个队列就行了,这样可以让我们的push操作本身达到 O ( 1 ) O(1) O(1)时间复杂度,另外我们从测试程序可以看出,测试程序传给push的值本身就是个move来的右值,这意味着传参的过程也是 O ( 1 ) O(1) O(1)的,因此实际上我们的这个操作时间复杂度就是 O ( 1 ) O(1) O(1)
在这里插入图片描述
不过我们还需要考虑pop的实现,pop要求实现任意合法字符数量的弹出,一般思路是不断遍历并弹出队首,直到队首的长度不小于剩余需要遍历的数量的长度为止,然后用一个指针标记一下这个串这次遍历到的位置,下次就从这里开始遍历即可。因此我们需要维护队首字符串的起始位置,一种很优雅的实现是来自C++17的std::string_viewstd::string_view实质上就是维护了连续字符内存上的两个指针。当然,我们也可以直接维护队首字符串的起始位置坐标,性能其实应该差距不大,这里就展示一下string_view吧。

4.2 代码展示

// byte_stream.hh
#pragma once

#include <queue>
#include <stdexcept>
#include <string>
#include <string_view>

class Reader;
class Writer;

class ByteStream
{
protected:
  enum State { CLOSED, ERROR };
  uint64_t capacity_;
  uint64_t bytes_pushed_ {}; // 已写入的字节数
  uint64_t bytes_popped_ {}; // 已弹出的字节数

  unsigned char flag {};	// 0: normal, 1: closed, 2: error
  std::queue<std::string> buffer_data {};
  std::string_view buffer_view {};

public:
  explicit ByteStream( uint64_t capacity );

  // 提供ByteStream的 reader 和 writer 接口的辅助函数
  Reader& reader();
  const Reader& reader() const;
  Writer& writer();
  const Writer& writer() const;
};

class Writer : public ByteStream
{
public:
  void push( std::string data ) noexcept; // 在可用容量允许的范围内向流中写入数据

  void close() noexcept; // 关闭流,不允许再向流中写入数据
  void set_error() noexcept; // 流中出现错误,置位错误标志

  bool is_closed() const noexcept;      // 判断流是否已关闭
  uint64_t available_capacity() const noexcept; // 计算流中剩余可用容量
  uint64_t bytes_pushed() const noexcept;       // 计算流中已写入的字节数
};

class Reader : public ByteStream
{
public:
  std::string_view peek() const noexcept; // 返回流中下一个数据块的只读视图
  void pop( uint64_t len ) noexcept;      // 从流中弹出指定长度的数据块

  bool is_finished() const noexcept; // 判断流是否已关闭且所有数据块都已弹出
  bool has_error() const noexcept;   // 判断流是否出现错误

  uint64_t bytes_buffered() const noexcept; // 计算当前流中剩余的字节数
  uint64_t bytes_popped() const noexcept;   // 计算流中已弹出的字节数
};

/*
 * read: A (provided) helper function thats peeks and pops up to `len` bytes
 * from a ByteStream Reader into a string;
 */
void read( Reader& reader, uint64_t len, std::string& out );
// byte_stream.cc
#include <stdexcept>

#include "byte_stream.hh"

using namespace std;

ByteStream::ByteStream( uint64_t capacity ) : capacity_( capacity ) {}

void Writer::push( string data ) noexcept
{
  auto len = min( data.size(), available_capacity() );	// 确定可写入的数据长度
  if ( len == 0 ) { // 如果可写入的数据长度为0,说明已经写满了,返回
    return;
  } else if ( len < data.size() ) { // 如果可写入的数据长度小于 data 的长度,说明只能写入部分数据
    data.resize( len );             // 将 data 的长度截断为可写入的长度
  }
  // 将 data 写入到 buffer 中
  buffer_data.push( move( data ) );
  if ( buffer_data.size() == 1)  // 写入前为空时需要更新 buffer_view
    buffer_view = buffer_data.front();   
  // 更新已写入的数据长度
  bytes_pushed_ += len;
}

void Writer::close() noexcept
{
  flag |= ( 1 << CLOSED );
}

void Writer::set_error() noexcept
{
  flag |= ( 1 << ERROR );
}

bool Writer::is_closed() const noexcept
{
  return flag & ( 1 << CLOSED );
}

uint64_t Writer::available_capacity() const noexcept
{
  return capacity_ - reader().bytes_buffered();
}

uint64_t Writer::bytes_pushed() const noexcept
{
  return bytes_pushed_;
}

string_view Reader::peek() const noexcept
{
  return buffer_view;
}

bool Reader::is_finished() const noexcept
{
  return writer().is_closed() && ( bytes_buffered() == 0 );
}

bool Reader::has_error() const noexcept
{
  return flag & ( 1 << ERROR );
}

void Reader::pop( uint64_t len ) noexcept
{
  if ( len > bytes_buffered() ) {
    return;
  }
  // 更新已弹出的数据长度
  bytes_popped_ += len;

  // 将 buffer 中的数据弹出
  while ( len > 0 ) {
    if ( len >= buffer_view.size() ) {
      len -= buffer_view.size();
      buffer_data.pop();
      buffer_view = buffer_data.front(); // 最开始就保证了 buffer_data 不为空
    } else {
      buffer_view.remove_prefix( len );
      len = 0;
    }
  }
}

uint64_t Reader::bytes_buffered() const noexcept
{
  return writer().bytes_pushed() - bytes_popped();
}

uint64_t Reader::bytes_popped() const noexcept
{
  return bytes_popped_;
}

4.3 代码测试

build下运行make check0,可以看到我的电脑上跑了10.90Gbit/s的速度,这个是和电脑有关的,我的电脑比较拉,和运气也有关系,当然和算法关系更大。
在这里插入图片描述

  • 17
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 14
    评论
oreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xv Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xix Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxi About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxiii Chapter 1 ■ Web 2.0 and Social Networking. . . . . . . . . . . . . . . . . . . 1 Web 2.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Ajax and the Dojo Toolkit . . . . . . . . . . . . . . . . . . . . . .6 Situation Applications and Mashups . . . . . . . . . . . . .12 Social Networking . . . . . . . . . . . . . . . . . . . . . . . . . .14 A Case Study: GBS Practitioner Portal . . . . . . . . . . .20 External Social Networking Sites . . . . . . . . . . . . . . .25 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 Chapter 2 ■ Portals in the Enterprise. . . . . . . . . . . . . . . . . . . . . . . 29 Exceptional User Interfaces . . . . . . . . . . . . . . . . . . .29 Portal Applications . . . . . . . . . . . . . . . . . . . . . . . . .39 Portlet Language Options . . . . . . . . . . . . . . . . . . . .52 IBM’s w3 Company Intranet . . . . . . . . . . . . . . . . . . .56 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 Chapter 3 ■ Ajax, Portlets, and Patterns. . . . . . . . . . . . . . . . . . . . 61 Portals and Portlets as a Platform . . . . . . . . . . . . . .61 Contents From the Library of Lee Bogdanoff Download at WoweBook.Com Web 2.0 and Social Networking for the Enterprise xii Writing Dojo Portlets . . . . . . . . . . . . . . . . . . . . . . . .69 Using WebSphere Portlet Factory . . . . . . . . . . . . . . .86 Comments from the IBM Labs . . . . . . . . . . . . . . . . .94 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98 Chapter 4 ■ Social Software for the Enterprise. . . . . . . . . . . . . . . . 99 Lotus Connections . . . . . . . . . . . . . . . . . . . . . . . .100 Managing Your Profile . . . . . . . . . . . . . . . . . . . . . .101 Sharing Ideas with Blogs . . . . . . . . . . . . . . . . . . . .105 Dogear Your Favorites . . . . . . . . . . . . . . . . . . . . . .107 Join In on the Activities . . . . . . . . . . . . . . . . . . . .109 Building Your Communities . . . . . . . . . . . . . . . . . .113 Integration with WebSphere Portal . . . . . . . . . . . . .118 Planning a Connections Deployment . . . . . . . . . . . .118 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119 Chapter 5 ■ Team Collaboration and Content Sharing. . . . . . . . . . 121 Lotus Quickr . . . . . . . . . . . . . . . . . . . . . . . . . . . .121 Working with Quickr Libraries . . . . . . . . . . . . . . . .129 Working with Quickr Connectors . . . . . . . . . . . . . . .132 Quickr Integration Through Feeds . . . . . . . . . . . . . .137 Notes from the Field: An Interview with Richard Gorzela . . . . . . . . . . . . . . . . . . . . . . . . . .144 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .148 Chapter 6 ■ Mashing Up Data and Applications. . . . . . . . . . . . . . 151 It’s More Than Just Maps! . . . . . . . . . . . . . . . . . . .151 IBM Mashup Strategy . . . . . . . . . . . . . . . . . . . . . .154 Lotus Mashups . . . . . . . . . . . . . . . . . . . . . . . . . . .155 InfoSphere MashupHub . . . . . . . . . . . . . . . . . . . .161 InfoSphere Feed Mashups . . . . . . . . . . . . . . . . . . .168 WebSphere sMash . . . . . . . . . . . . . . . . . . . . . . . .169 From the Library of Lee Bogdanoff Download at WoweBook.Com Contents xiii Sample sMash Applications . . . . . . . . . . . . . . . . . .181 An Interview with IBM’s Mashup Architects . . . . . . .181 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187 Chapter 7 ■ Enterprise Search Strategies. . . . . . . . . . . . . . . . . . 189 Why Not Use Google? . . . . . . . . . . . . . . . . . . . . . .190 Introduction to IBM OmniFind . . . . . . . . . . . . . . . .191 How IBM Uses OmniFind Enterprise Edition . . . . . .196 Using Tagging to Find Information . . . . . . . . . . . . .198 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .202 Chapter 8 ■ Web 2.0 Security and Performance. . . . . . . . . . . . . . 203 Common Attack Vectors . . . . . . . . . . . . . . . . . . . .204 Portal Proxy . . . . . . . . . . . . . . . . . . . . . . . . . . . . .210 Rational AppScan . . . . . . . . . . . . . . . . . . . . . . . . .211 Web Application Security Consortium . . . . . . . . . . .214 Public Sites Security Issues . . . . . . . . . . . . . . . . . .215 Performance Is Never Free . . . . . . . . . . . . . . . . . .216 Consider Caching . . . . . . . . . . . . . . . . . . . . . . . . .220 Rational Performance Tester . . . . . . . . . . . . . . . . .223 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .226 Chapter 9 ■ Managing a Changing Social World. . . . . . . . . . . . . 227 The New “Virtual” Water Cooler . . . . . . . . . . . . . . .228 Where Do You Start? . . . . . . . . . . . . . . . . . . . . . . .231 A Three-Stage Roadmap . . . . . . . . . . . . . . . . . . . .234 Defining Goals and Business Requirements . . . . . . .238 Getting Acceptance and Adoption . . . . . . . . . . . . .240 Assessing Your Strategy . . . . . . . . . . . . . . . . . . . . .242 Governance for Social Networking . . . . . . . . . . . . .245 Web 2.0 and Agile Development . . . . . . . . . . . . . .248 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .248 From the Library of Lee Bogdanoff Download at WoweBook.Com Chapter 10 ■ IBM Case Studies. . . . . . . . . . . . . . . . . . . . . . . . . . 251 Lotus Greenhouse . . . . . . . . . . . . . . . . . . . . . . . . .251 Helping Customers Grow and Learn . . . . . . . . . . . .253 IBM in the Cloud . . . . . . . . . . . . . . . . . . . . . . . . .257 IdeaJam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .267 Technology Adoption Program . . . . . . . . . . . . . . . .269 My developerWorks . . . . . . . . . . . . . . . . . . . . . . . .271 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .274 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
CS144是一门名为"Introduction to Computer Networking"的课程,引用显示您所参加的是2021年秋季学期的版本。关于cs1442023年的信息,我们需要参考引用和引用中提供的运行结果和命令含义。 从引用中的运行结果可以看出,telnet程序成功连接到了cs144.keithw.org服务器,并发送了一个GET请求,请求路径为/hello。服务器返回了200 OK的状态码,表示请求成功。响应中的内容为"Hello, CS144!"。 根据引用中对telnet命令的解释,telnet程序在主机和服务器之间打开了一个可靠的字节流连接,连接的应用进程是http。 综上所述,cs1442023年的运行结果是成功连接到了cs144.keithw.org服务器,并获取到了服务器返回的"Hello, CS144!"的消息。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [【斯坦福计网CS144项目】环境配置 & Lab0: ByteStream](https://blog.csdn.net/Altair_alpha/article/details/125010070)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* [【CS144lab0](https://blog.csdn.net/xsf_1903239203/article/details/130416129)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 14
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值