29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

RM0008<br />

Ethernet (ETH): media access control (MAC) with DMA controller<br />

2 You must make sure the Transmit FIFO is deep enough to store a complete frame before<br />

that frame is transferred to the MAC Core transmitter. If the FIFO depth is less than the input<br />

Ethernet frame size, the payload (TCP/UDP/ICMP) checksum insertion function is bypassed<br />

<strong>and</strong> only the frame’s IPv4 Header checksum is modified, even in Store-<strong>and</strong>-forward mode.<br />

The transmit checksum offload supports two types of checksum calculation <strong>and</strong> insertion.<br />

This checksum can be controlled for each frame by setting the CIC bits (Bits 28:27 in<br />

TDES1, described in TDES1: Transmit descriptor Word1 on page 889).<br />

See IETF specifications RFC 791, RFC 793, RFC 768, RFC 792, RFC 2460 <strong>and</strong> RFC 4443<br />

for IPv4, TCP, UDP, ICMP, IPv6 <strong>and</strong> ICMPv6 packet header specifications, respectively.<br />

● IP header checksum<br />

In IPv4 datagrams, the integrity of the header fields is indicated by the 16-bit header<br />

checksum field (the eleventh <strong>and</strong> twelfth bytes of the IPv4 datagram). The checksum<br />

offload detects an IPv4 datagram when the Ethernet frame’s Type field has the value<br />

0x0800 <strong>and</strong> the IP datagram’s Version field has the value 0x4. The input frame’s<br />

checksum field is ignored during calculation <strong>and</strong> replaced by the calculated value. IPv6<br />

headers do not have a checksum field; thus, the checksum offload does not modify<br />

IPv6 header fields. The result of this IP header checksum calculation is indicated by the<br />

IP Header Error status bit in the Transmit status (Bit 16). This status bit is set whenever<br />

the values of the Ethernet Type field <strong>and</strong> the IP header’s Version field are not<br />

consistent, or when the Ethernet frame does not have enough data, as indicated by the<br />

IP header Length field. In other words, this bit is set when an IP header error is<br />

asserted under the following circumstances:<br />

a) For IPv4 datagrams:<br />

– The received Ethernet type is 0x0800, but the IP header’s Version field does not<br />

equal 0x4<br />

– The IPv4 Header Length field indicates a value less than 0x5 (20 bytes)<br />

– The total frame length is less than the value given in the IPv4 Header Length field<br />

b) For IPv6 datagrams:<br />

– The Ethernet type is 0x86DD but the IP header Version field does not equal 0x6<br />

– The frame ends before the IPv6 header (40 bytes) or extension header (as given<br />

in the corresponding Header Length field in an extension header) has been<br />

completely received. Even when the checksum offload detects such an IP header<br />

error, it inserts an IPv4 header checksum if the Ethernet Type field indicates an<br />

IPv4 payload.<br />

● TCP/UDP/ICMP checksum<br />

The TCP/UDP/ICMP checksum processes the IPv4 or IPv6 header (including<br />

extension headers) <strong>and</strong> determines whether the encapsulated payload is TCP, UDP or<br />

ICMP.<br />

Note that:<br />

a) For non-TCP, -UDP, or -ICMP/ICMPv6 payloads, this checksum is bypassed <strong>and</strong><br />

nothing further is modified in the frame.<br />

b) Fragmented IP frames (IPv4 or IPv6), IP frames with security features (such as an<br />

authentication header or encapsulated security payload), <strong>and</strong> IPv6 frames with<br />

routing headers are bypassed <strong>and</strong> not processed by the checksum.<br />

Doc ID 13902 Rev 9 857/995

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!