Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ASK] Ethernet Frame struct #77

Closed
LuoZijun opened this issue Nov 9, 2017 · 6 comments
Closed

[ASK] Ethernet Frame struct #77

LuoZijun opened this issue Nov 9, 2017 · 6 comments

Comments

@LuoZijun
Copy link
Contributor

LuoZijun commented Nov 9, 2017

Code Lines: https://github.com/m-labs/smoltcp/blob/master/src/wire/ethernet.rs#L88-L91

The wiki page: https://en.wikipedia.org/wiki/Ethernet_frame#Structure

as you can see, wikipedia said ethernet frame after payload filed, have one Frame check sequence (32‑bit CRC) field , but i have not see in we ethernet frame struct .

@whitequark
Copy link
Contributor

The frame check sequence, just like the preamble and start delimiter, are handled by hardware.

@whitequark
Copy link
Contributor

Note the difference between ethernet packet and ethernet frame; the packet includes preamble and FCS, whereas the frame does not.

@LuoZijun
Copy link
Contributor Author

LuoZijun commented Nov 9, 2017

@whitequark

image

thx, the wikipedia lie to me -_-

@LuoZijun
Copy link
Contributor Author

LuoZijun commented Nov 9, 2017

@whitequark

now the wikipedia page Ethernet_frame have been fixed 😄

thank you let me know that.

@LuoZijun LuoZijun closed this as completed Nov 9, 2017
@whitequark
Copy link
Contributor

Looks like the Wikipedia people disagree: https://en.wikipedia.org/w/index.php?title=Ethernet_frame&diff=809483347&oldid=809464039
Oh well. In any case, it's virtually always handled by hardware, so there is no point in exposing it to software.

@LuoZijun
Copy link
Contributor Author

okay

kent-mcleod added a commit to kent-mcleod/rustwall that referenced this issue Jun 7, 2018
The crc checksum from the ethernet frame is ignored by the smoltcp
EthernetFrame struct (See: smoltcp-rs/smoltcp#77).
This new function checks if the crc frame is left on the end of the ipv4
frame and reduces the slice size accordingly. This fixes any out of
bounds errors from when the ipv4 length is assumed based on the length
of the slice rather than the header value.
kent-mcleod added a commit to kent-mcleod/rustwall that referenced this issue Jun 7, 2018
The crc checksum from the ethernet frame is ignored by the smoltcp
EthernetFrame struct (See: smoltcp-rs/smoltcp#77).
This new function checks if the crc frame is left on the end of the ipv4
frame and reduces the slice size accordingly. This fixes any out of
bounds errors when handline fragmentation from when the ipv4 length is assumed based on the length
of the slice rather than the header value.
astro added a commit to astro/smoltcp that referenced this issue Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants