为什么帧检查序列位于以太网帧的末尾而不是其他位置 [英] Why is the Frame Check Sequence at the end of an Ethernet frame and not somewhere else

查看:249
本文介绍了为什么帧检查序列位于以太网帧的末尾而不是其他位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以太网帧检查序列始终附加在数据链路层的帧末尾.为什么将它附加到框架的末尾而不是其他地方?

An Ethernet Frame Check Sequence is always appended to the end of a frame in the Data Link Layer. Why is it appended to the end of the frame and not somewhere else?

我考虑了一下,认为它可能与例如如果帧的结构是header + payload + crc而不是header + crc + payload,则可以计算CRC校验和,并且由硬件更容易执行.

I thought about it and think it might have something to do with how e.g. CRC-checksums are calculated and that it's easier performed by hardware if the structure of a frame is header+payload+crc rather than header+crc+payload.

CRC对形式(数据+填充)/除数进行XOR划分,对于最后一帧,填充被其余部分替换.接收器然后计算(数据+余数)/除数,如果结果为0,则接受该帧.

CRC performs an XOR division of the form (data+padding)/divisor, and for the final frame the padding is replaced by the remainder. The receiver then calculates (data+remainder)/divisor and accepts the frame if the result is 0.

推荐答案

您是正确的:将CRC放在帧的末尾可减少数据包延迟并降低硬件缓冲要求.在发送端,硬件可以立即读取和发送帧的字节.发送器在数据通过时即时计算CRC,然后将CRC附加到帧尾.

You are correct: placing the CRC at the end of a frame reduces packet latency and reduces hardware buffering requirements. On the transmit side, hardware can read and transmit bytes of the frame immediately. The transmitter calculates the CRC on the fly as data passes through, then simply appends the CRC the tail of the frame.

考虑将CRC放在以太网报头中某处的替代方法.硬件必须读取并存储整个帧才能计算CRC.这意味着大量的超前操作,并显着增加了传输延迟和硬件成本.接收者的情况也变得更加复杂.

Consider the alternative where the CRC comes somewhere in the Ethernet header. Hardware must read and store the entire frame in order to calculate the CRC. This amounts to a large look-ahead operation and adds significantly to transmit latency and hardware cost. The situation also becomes more complex for the receiver as well.

这篇关于为什么帧检查序列位于以太网帧的末尾而不是其他位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆