- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to understand why the FCS generated by Altera 10G Ethernet in this example is 0x4EB30AF4 (page 7-10, 10G Ethernet MAC Mega Function)
Packet: EE CC 88 CC AA EE EE CC 88 CC AA EE 00 2E 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D <------ DA------->|<------ SA------->|<len>|<----------------------------------------------------------------Payload--------------------------------------------------------------------------------------> My computation by Hexprobe calculator says 0x7AB2625B assuming an initial value of 0xFFFFFFFF: http://www.alteraforum.com/forum/attachment.php?attachmentid=10175&stc=1 I appreciate if anyone can explain to me how FCS is implemented in ethernet protocol. I have read IEEE 802.3 but I did not understand it:3.2.9 Frame Check Sequence (FCS) field
A cyclic redundancy check (CRC) is used by the transmit and receive algorithms to generate a CRC value
for the FCS field. The FCS field contains a 4-octet (32-bit) CRC value. This value is computed as a function
of the contents of the protected fields of the MAC frame: the Destination Address, Source Address, Length/
Type field, MAC Client Data, and Pad (that is, all fields except FCS). The encoding is defined by the following
generating polynomial.
G(x) = x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1
Mathematically, the CRC value corresponding to a given MAC frame is defined by the following procedure:
a) The first 32 bits of the frame are complemented.
b) The n bits of the protected fields are then considered to be the coefficients of a polynomial M(x) of
degree n – 1. (The first bit of the Destination Address field corresponds to the x(n–1) term and the last
bit of the MAC Client Data field (or Pad field if present) corresponds to the x0 term.)
c) M(x) is multiplied by x32 and divided by G(x), producing a remainder R(x) of degree ≤ 31.
d) The coefficients of R(x) are considered to be a 32-bit sequence.
e) The bit sequence is complemented and the result is the CRC.
The 32 bits of the CRC value are placed in the FCS field so that the x31 term is the left-most bit of the first
octet, and the x0 term is the right most bit of the last octet. (The bits of the CRC are thus transmitted in the
order x31, x30,…, x1, x0.) See Hammond, et al. .
3.3 Order of bit transmission
Each octet of the MAC frame, with the exception of the FCS, is transmitted least significant bit first.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just figured it out. You need to reverse-byte the message, and then reverse-byte it again at the end. Can someone shoot the guys in IEEE for making this so complicated, cause I just spent a day figuring out this :cool:
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page