Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] UDP Communication through FPGA

Status
Not open for further replies.

luqman_abbas2

Junior Member level 1
Junior Member level 1
Joined
Nov 15, 2012
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,397
HEY all!

I have done UDP reception through microblaze and i have extracted the data from that using EMAClite.

Now i am making a UDP trnsmitter, i have made ethernet frame and calculated all checksum correctly with placing a known data.

the problem is just in two bytes of ethernet frame."the ethernet protocol field bytes" which are to be 0x0800 for IP type protocol.
when i place this info in packet the frame is not gathered on wireshark even in promiscious mode, bt when i put any othr info in that the frame is declared "bogus" or "malformed" by wireshark.

can anybody suggest what to do?

thanks in advance!
 

Post your entire IP header.

The alignment of the 0x0800 doesn't make sense as the protocol field is only 8-bits.

0x11 is UDP

-alan
 

In UDP communication checksum is not a MUST!, so try forcing the checksum to zero. please put the enite packet u r seeing in wireshare here!!
 

Post your entire IP header.

The alignment of the 0x0800 doesn't make sense as the protocol field is only 8-bits.

0x11 is UDP

-alan

In UDP communication checksum is not a MUST!, so try forcing the checksum to zero. please put the enite packet u r seeing in wireshare here!!

FF FF FF FF FF FF 06 05 04 03 02 01 08 00 45 00 00 2E 00 00 00 00 80 11 B9 6B C0 A8 00 01 C0 A8 00 02 1F 90 1F 90 00 1A DE DD 12 34 56 78 90 11 22 33 44 55 66 77 88 99 00 11 12 00


when i put the highlighted 2 bytes in packet the wireshark donot gather the packet if i put 0x0000 wireshark says bogus/malframed .
 

Wireshark receives the all the packets which are forwarded from NIC card to processor.
NIC card discards the packets only if destination address is not matched.
From the above packet I understood that the Destination address is "FFFFFFFFFFFF", which is a broadcast packet and NIC card wont drop this kind of packets.
R u setting any filtering options in wireshark?

This link might be helpful.
https://www.codeproject.com/Articles/31920/How-to-craft-UDP-packets-and-send-them-with-WinPCa
 
Last edited:
Wireshark receives the all the packets which are forwarded from NIC card to processor.
NIC card discards the packets only if destination address is not matched.
From the above packet I understood that the Destination address is "FFFFFFFFFFFF", which is a broadcast packet and NIC card wont drop this kind of packets.
In any case whether the filed is "0000" or "8000" it doesnt matter.
R u setting any filtering options in wireshark?

This link might be helpful.
https://www.codeproject.com/Articles/31920/How-to-craft-UDP-packets-and-send-them-with-WinPCa

i have tried with giving MAC address of nic as dst. MAC as address the results are same.
and i hven't setted any filtering options in wireshark!
 

In any case whether the filed is "0000" or "8000" it doesnt matter.
yourcheers, The 0x0800 is specifies the packet is IPv4. You can't just put 0x0000 there it's not defined:
https://en.wikipedia.org/wiki/EtherType

The checksum calculation is somewhat tricky and could be why the packet is getting discarded. Sending a 0x0000 for the checksum signals the destination that a checksum wasn't computed.

This is what a IPv4 carrying UDP packets should look like.


I'm not sure your IP packet is valid, what did you base the header encapsulation format on?

- - - Updated - - -

I now see that you've included the Ethernet header so the field you are highlighting should be one of the following....
https://www.cavebear.com/archive/cavebear/Ethernet/type.html

It should be something between 0x0000-0x05DC if you want a length.

So six octets of 0xFF, six octets of source addr, and either a VLAN tag 0x8100 w/ VLAN info (2 octets) or the 2 octet MAC Client length/type (0x0800 is IPv4 if 0x0000 it's a length field of 0).
This is followed by my previous diagram of the IPv4 headers and UDP headers.
 

Okay I checked, and your header checksum is correct.

I haven't verified your UDP checksum, though it is optional in IPv4 so you can put in 0x0000.
 

Hay ads_ee,
Yes, I was wrong. I wanted to write about checksum, but some how made the mistake,
 

I doubt the core is computing the wrong FCS. It's more likely the way you hooked up the core. I've used Altera's Ethernet MAC core before and we didn't have any issue with UDP packets being sent through it.

I don't recall the details (as the project was >3 years ago), but I believe there were some options when creating the core for FCS and some connections on the core involving the FCS calculation. Something like you can bypass it and put in your own FCS or something like that.

-alan
 

Well folks Thanks for directing me help in my stuff!
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top