11 years, 1 month ago.

Ethernet peripheral setting.

Hello,

I'm making a TCP / IP library that is different from the mbed-official for mbed1768.

However, my TCP/IP stack attaches an unknown "trailer" is to the tail of the IP packet always.

For example, when I send an Ethernet frame of 1500 bytes, Total ethernet frame will be sent with including one byte unknown data (1501 bytes)

I'm considered to have failed to set up peripherals, but I can not find out the information.

Someone know any information?

/media/uploads/nyatla/unknown-trailer.png

2 Answers

11 years, 1 month ago.

Try sending a dummy ethernet frame without involving your IP stack code. Then you will know if you are adding the extra byte or if the Ethernet library is adding it. I'm assuming you are using the mbed Ethernet library.

It smells like an old-fashioned "off by one" error in your IP stack code, though. If the Ethernet library had such a simple problem, it would have surfaced by now.

At least I'm assuming you have your IP and TCP code connected, since wireshark is showing IP addresses and socket ports and protocol TCP.

The fact that wireshark has "VSS-Monitoring ethernet trailer" hi-lited implies that maybe that's what it is. Google that term and read about it - it sounds like some harmless diagnostic data appended by the hardware that you don't need to worry about.

We can't see your ethernet header to see if the payload length is 1500 there - check that. If so, I think you are meant to ignore byte 1501.

posted by Dave Bracey 16 Oct 2013
Ryo Iizuka
poster
11 years, 1 month ago.

Thank you for reply.

My explanation may not have enough.

mbed officials ethernet driver and IP stack is no problem.It does not occur at all. It occurred in my IP stack and Ethernet driver.

I have solved the problem. There is the report.

Problem was size to be set for the Ethernet transmit descriptor. At UM10360.pdf, 181. Transmit descriptor control word Table said "The size of ethernet frame must be encode -1 from packet size."

My code based on uIp of FreeRTOS. It had not -1 encoding. I have add -1 encoding to my ethernet driver, to remove problem. It work correctly.

include the mbed library with this snippet

	TX_DESC_PACKET( Index ) = ( unsigned long )(i_buf+1);
	//See UM10360.pdf Table 181. Transmit descriptor control word
	TX_DESC_CTRL( Index ) = ((i_size-1) | TCTRL_LAST | TCTRL_INT );
	LPC_EMAC->TxProduceIndex = IndexNext;

If the failure of the same came out in the IP stack of the other, the Ethernet driver, we can fix by this way.