TTCP

https://en.wikipedia.org/wiki/Transmission_Control_Protocol

implementations and dertvatives: Iperf

What performmance do we care?

image.png

  • 带宽
  • 吞吐量
  • 延迟
  • 资源使用率
  • 额外开销

    • 先压缩后加密, 否则起不到压缩的作用了

      Why do we re-implement TTCP?

      image.png
  • 基于常用的Socker API

  • TTCP协议有格式的; echo通常是接受什么, 发送什么, 忽略TCP的格式
  • 使用TCP的典型协议
  • 可以使用多种语言实现
  • 没有并发连接

The Protocol

请求-响应协议
image.png

  • 收到Ack, 才会返回Payload

The Code

image.png
Straight forward with blocking IO/ 直线型阻塞IO

Non-blocking IO with muduo library

None of above support concurrent connections

  • Pretty easy to anable, thread-per-connections for first three

    不支持并发连接