Strange behavior on Ethernet interface

Hi All ,

I have a sockets application running on PC and I am using it to test the ethernet interface of an embedded system (microblaze interfaced to external SMSC MAC/Phy Chip). I am sending UDP packets only. The embedded system is not running a TCP/IP protocol stack and is bare bone , in premiscous mode and accepts any thing without packet filtering(I have to initiate the sockets connection by sending an ARP response to a ARP request first).

Now here is the strange behaviour - In the UDP payload I have Packet header encoded , which is incremented on each transmit. When the embedded side receives the packet ( interrupt based) it prints the packet number received on a debug console. The packet number that it is printing is as follows -

000000000......series of 0s........111111111111111...series of 1s............222222222 series of 2s up to n.

but when I sniff on the PC side with wireshark , I can see that the correct sequence is sent.

If I test the system using winpcap to send and recieve packets it works fine with no problems.

At first I thought it is a problem with ISR , but the same results happen when using polling. on the MAC/phy side no hardware overflow occurs. Is it something to at the bus level?

The packets are being sent every ~50ms ( not any faster). Microblaze is working on 50MHZ clock. The SMSC MAC/PHY chip is configured to be

10M data rate.

Any help will be appreciated.

BR Rate

Reply to
ratemonotonic
Loading thread data ...

My first suspect would be a bug in your debug output code, printing the same byte or nibble several times rather than the full number. Or possibly the comparable error in decoding that field of the header.

Are you saying a packet generated in this way is printed out with ordinarily incrementing numbers by the embedded system?

Reply to
cs_posting

I think, you need to double-check the code at this place.

Karthik Balaguru

Reply to
karthikbalaguru79

Yes, thats the strange thing. When I send data straight through using WinpCap API directly to the embedded side, the packet numbers are fine.

Its as though when I use sockets there is a strange echo of packets ? I have never seen this before.

BR Rate

Reply to
ratemonotonic

How often is your application sending a packet?

What if you modify it so it sends once per tap of the return key?

Reply to
cs_posting

The appications that I am integrating with is a using sockets and when I send one packet at a time it is fine i.e. I get 1 2 3 ...... but when I start sending data at every ~50 ms for example it starts the wierd behavior!

Now when I send data using my own application using winpcap API and the same embedded software and same data, at every 50ms 20 ms 10 ms I cannot reproduce the strange behaviour. If I go faster that 10ms , I get ethenet MAC hardware overflow error interrupts but thats down to my processor speed. When overflow occurs I miss intermitent packets , but never do I get a series of 111111111 and so on!

Strange problem , but it will be very interesting when I get to the bottom of it ;-)

Reply to
ratemonotonic

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.