Avatar CS Knowledge Wiki

16 TCP part 2

Short gets (DNS, DHCP) > Use datagrams > Internet Datagrams

Stacks of service abstraction#

Short gets (DNS, DHCP) -> Use datagrams -> Internet Datagrams

Byte Stream –(TCP)—> User datagrams -> Internet Datagrams

  • Web requests/responses (HTTP) -> Byte Stream Youtube/Wikipedia -> Web requests/responses
  • Email sending (SMTP) -> Byte Stream
  • Email receiving (IMAP) -> Byte Stream

Multiplexing ByteStream#

“u8 u8” (Which byte stream; what is the byte)

  • Any reading and writing of one byte would be actually two bytes, the first byte for which byte stream and the second for the actual byte

“u8 u8 {u8 u8 … u8}” (which byte stream; size of payload; sequence of characters of the string chunk)

  • Any reading and writing of n bytes would be actually n + 2 bytes
  • Tagged byte stream: HTTP/2 | SPDY ↗

How to make ByteStream push idempotent?#

TCP Sender Message#

  • first_index
  • data
  • FIN

image2.png

This works for out-of-order or multiple deliveries. Since UDP has a checksum field, altered TCP Message would be ignored on the UDP layer.

What if datagrams are missing?

  • How does the sender know that a datagram needs to be sent multiple times?
  • DNS/DHCP: if we don’t receive an answer, then we retransmit. But such response/answer does not exist in pushing (void push())

Acknowledgement#

TCP Receiver Message

  • “A B C D E F G” each byte sent as a separate TCP sender message, and “D” is not received.
  • “I got the sender message with first-index = 2, length = 1.”
    • Valid but more work. There will be one receiver message for each sender message.
  • “Got anything? Y/N. Next needed: #3.”
    • Acknowledgements are accumulative, and that make life simpler.
  • Give FIN flag a number: “A B C D E F G FIN”.

TCP Sender Message: {sequence number, data}

TCP Receiver Message: {Next needed: optional<int>} and TCP Receiver Message {Next needed: optional(8)} would mean FIN is received.

TCP Receiver Message: {Next needed: optional<int>; available capacity:int}

  • {Next needed: optional(3); available capacity: 2} === Receiver wants to here about “DE”.
  • “DE” is the window. (Red area in that picture of lab 1)

TCP Receiver Message: {Ack no: optional<int>; window size: int}

TCP Segment#

image.png

This is the service abstraction that TCP is providing:

image.png

And this is what happens under the hood (and also what you will be implementing in the labs)

image.png

Rules of TCP#

Reply to any nonempty TCP Server Message

Knowledge map

知识图谱

当前文档、同目录指南与引用关系。

准备中 全局图谱

正在构建知识图谱...

拖动节点 · 滚动缩放 · 点击打开

帮助与支持

这篇文档有帮助吗?

请给我们反馈以改进文档质量
(点击按钮后会打开邮箱)

帮助改进文档

所有文档均开源,发现问题或不清楚的地方?提交 PR 来帮助改进。

编辑此页面 了解如何贡献 →

需要更多帮助?

加入社区或直接联系获取支持

文件管理器 /
位置 /
内容
Knowledge explorer

知识图谱

全部知识 准备图谱...
文章 文档 标签 分类

正在加载知识网络...

拖动节点 · 滚动缩放 · 单击查看详情 · 双击打开页面
标签云 / Tag Cloud