help with ARP protocol

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
trolly
Member
Member
Posts: 52
Joined: Tue Mar 25, 2008 12:26 pm

help with ARP protocol

Post by trolly »

hi,

i've some problem to implement the ARP to my network stack.
My driver seem to work (ne2k isa), also i try to begin the network layer.
the problem is, when i send an arp request, the driver says me that the packet is transmitted,
but i never get an response from the network, what the problem? (i use qemu)
i hope i fill the packet with the correct values
i join a screen shot, you can see a dump from the sended packet (each bytes separated by spaces), maybe i've put a wrong value somewhere.
sshot.png
sshot.png (11.59 KiB) Viewed 2766 times
]
User avatar
JackScott
Member
Member
Posts: 1035
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Mastodon: https://aus.social/@jackscottau
Matrix: @JackScottAU:matrix.org
GitHub: https://github.com/JackScottAU
Contact:

Re: help with ARP protocol

Post by JackScott »

First of all, this is the wrong forum for this post. It should be in the OS Development forum.

As for your actual problem, I'd suggest using a packet analyzer to find out where the packet went in your network. It's possible you got a reply but didn't notice, or that your request was malformed, or any number of other combinations could have gone wrong. Maybe somebody else with more networking knowledge will be able to help more.

http://en.wikipedia.org/wiki/Packet_analyzer
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: help with ARP protocol

Post by Troy Martin »

Oh, and another thing that helps us with code issues: the code.

*now turning annoying b!tch mode off*
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: help with ARP protocol

Post by Combuster »

Jack Scott is right - A packet analyzer like ethereal can tell you what and if there's being sent over the network. Use that to see at what stage in the process the information is lost.

And please use the theory forum for theory only.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: help with ARP protocol

Post by pcmattman »

Also, do you write the MAC into the PROM of the card at any time?
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Re: help with ARP protocol

Post by 01000101 »

things to check:
1: do you pad the size of your packet (as it's under the minimum of 60 bytes)?
2: if not, does your card do it for you, or discard it as a runt?
3: extending off of pcmattman, do you have multicast or other filters enabled or not-initialized? (that can lead to you not recieving a packet due to it not "matching" up right and getting dropped by your filters.
4: do you do trasmission error/status checking? if not... you should!
5: not sure if you're hard-coding those IP values or not so I can't tell if you've DHCP'd already, but do you ACK the interrupt correctly? if not, you won't recieve *any* more packets.

I don't have wireshark on this machine so I can't compare your values, but like already mentioned, grab a packet sniffer!
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Re: help with ARP protocol

Post by iammisc »

I don't know too much about qemu or networking, but one thing I do know is that without TUN/TAP networking qemu only implements a limited networking subset (e.g. AFAIK TCP/IP). So if you are not using TUN/TAP, maybe you should to get full networking support.
trolly
Member
Member
Posts: 52
Joined: Tue Mar 25, 2008 12:26 pm

Re: help with ARP protocol

Post by trolly »

i solved the problem,

i looked in the docs about the dp8930 chip and i see that the packed should be min 46 bytes., i've padded the packet, and now it work
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Re: help with ARP protocol

Post by 01000101 »

it's not specific to that chipset. Packets that are sent with a size < 60 or > 1514 (no jumbo support) will normally get rejected by a sane TCP/IP stack for being a RUNT or being LONG. The only difference you might see as far as chipset padding, is a register (or other interfacing item) that allows you to tell the hardware to pad for you.
Post Reply