最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

network programming - Why is ACK a field which every TCP segment has to have, and not a field in the Options part of the TCP seg

programmeradmin6浏览0评论

Why is ACK included in two segments sent in a row without receiving any segment between the transmission of both of them? Couldn't/Shouldn't you not include the ACK in the second segment, because it's known that the ACK wouldn't change between the two segments? (because in this case, you're not giving any new-information to the receiver).

An example: (taken from this)

[1] Client -> SYN, SEQ=100
[2] Client <- SYN, ACK, SEQ=700, ACK=101 <- Server
[3] Client -> ACK = 701, SEQ=101 [50 Bytes of data]
[4] Client -> ACK = 701 [Again, didn't receive sth from server yet], SEQ = 151 

In this example, couldn't the ACK = 701 in line [4] be emitted, because it's already mentioned in line [3], and because no segment has been received between the transmission of the packets in lines [3] & [4] ?

Edit:

An answer would be that the ACK field in a TCP segment is always present in a TCP segment, and hence the ACK field has to contain a value, and instead of making the value a garbage value and having the ACK flag as 0, we instead have the ACK flag as 1 and have the ACK field store an actually useful and correct value, which can only improve the connection's reliability, and wouldn't harm the performance.

The problem is that then rises another question: Why isn't the ACK an optional field (a field in the Options part of the TCP segment)? Which would usually be included, but would be emitted in cases just as described in the example provided above. This could improve performance, because this way there wouldn't be as many redundant ACK fields sent again and again across the network.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论