简体   繁体   English

仅使用NAK的数据传输协议如何才能可靠?

[英]How can a Data Transfer Protocol using NAKs only be reliable?

I have been studying a book on Computer Networking (this is not a homework question) 我一直在学习有关计算机网络的书(这不是作业问题)

One of the questions compares ACK and NAK based data transfer protocols, with the emphasis being that for a NAK based protocol, packet loss can for packet x can be detected by the received when the (x + 1)th packet is received. 问题之一是比较基于ACK和NAK的数据传输协议,重点是对于基于NAK的协议,当接收到第(x +1)个数据包时,可以通过接收到的数据包检测到数据包x的数据包丢失。

However, my issue is that what happens if the NAK sent by the receiver is lost before it gets to the sender? 但是,我的问题是,如果接收方发送的NAK在到达发送方之前丢失了怎么办? The sender will not be aware of errors and will not retransmit. 发件人将不会发现错误,也不会重新发送。 Furthermore, what if the packet is the last one in the sequence? 此外,如果数据包是序列中的最后一个数据包,该怎么办? (there is no subsequent packet to test with) (没有后续数据包可用于测试)

I do not see how a NAK-only protocol can be reliable (delivers each packet in the correct order) 我看不到仅NAK协议的可靠性如何(以正确的顺序传送每个数据包)

I suspect that the theoretical context described in the book assumes an infinite stream of packets and ignores conditions like the channel becoming completely disabled. 我怀疑书中所描述的理论背景假设了无限的数据包流,而忽略了诸如通道被完全禁用之类的条件。 In practice, there are other constructs defined as part of the ACK/NAK protocol or left up to higher or lower layer layer protocols to deal with. 在实践中,还有其他构造被定义为ACK / NAK协议的一部分,或者由更高或更低的层协议来处理。 For instance, a physical layer would provide indications like "the channel is broken", and perhaps a protocol above sends/receives "end-of-stream" packets, with a timer detect the case where the NAK for the last packet is lost. 例如,物理层将提供诸如“信道断开”之类的指示,并且也许上面的协议发送/接收“流的末尾”分组,而计时器则检测最后一个分组的NAK丢失的情况。 These are just hypothetical examples, but are the types of things real-life protocols do. 这些只是假设的示例,而是现实协议中所做的事情的类型。

I do not see how a NAK-only protocol can be reliable (delivers each packet in the correct order) 我看不到仅NAK协议的可靠性如何(以正确的顺序传送每个数据包)

I'm sure the book is implying there is some sort of mechanism for identifying packets in order. 我确信这本书暗示着某种机制可以按顺序识别数据包。 Otherwise, there would be no way for the receiver to indicate which packet it is NAK'ing, ie, most protocols use a sequence number in each packet/ack/nak. 否则,接收器将无法指示它正在对哪个数据包进行NAK,即大多数协议在每个数据包/确认/无效中使用序列号。

仅NAK协议可以通过使接收方在发送NAK时启动计时器并在计时器重新发送丢失的数据包之前超时而重新发送NAK来实现可靠性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM