ednozzle
December 6th, 2007, 01:41 PM
I fairly new to networking, and I'm trying to write up a UDP client & server using IPv6. Sadly, I seem to send out messages fine, but they do not get picked up by the server. I'm trying to nail down where my problem is. I used Wireshark to see that the packet is getting sent out, so I initially ruled out the client. However, I used netstat with the command "netstat -a -p udpv6", and it shows an entry on the port I use. So...it seems like it's sending and listening, yet somehow nothing happens. Does that mean that I didn't properly set up the port to listen to the multicast group? Could there be other points of failure?
Another noteworthy issue that may or may not be related: There's an existing IPv4 UDP system which I'm porting, but is still active in the code I'm debugging. As I understand it, that won't be a conflict. Anyway, if I run the client & server on the same machine, Wireshark sees the IPv4 message from the client, but not the IPv6 message. However, if I run the client on a different machine on the same subnet, it sees both IPv4 & IPv6.
I'd be happy to post code snippets if that's necessary, but if someone wanted to give me a bullet list of what to do where, that's be easier for me and probably faster for you.
Thanks in advance for your help!
Edit: Maybe it'd help if I gave a quick rundown of what calls I make. I'll strip out the unnecessary details.
Server:
1) getaddrinfo(null, myPort,...) using hints containing AI_PASSIVE, AF_INET6, SOCK_DGRAM & IPPROTO_UDP
2) socket() on result of #1
3) setsockopt(hSocket, SOL_SOCKET, SO_REUSEADDR...)
4) bind()
5) getaddrinfo("FF1E::FFFF", null...) no hints here
6) create a ipv6_mreq
7) set mreq's address to the result of #5, set interface to 0
8) setsockopt(...IPPROTO_IPV6, IPV6_JOIN_GROUP, mreq...)
After #8, I create an event, which would be fired upon receipt of a message, but it never happens.
Client:
1) getaddrinfo(null, myPort...) using hints containing AF_INET6 & SOCK_DGRAM
2) socket() on result of #1
3) setsockopt(hSocket, SOL_SOCKET, SO_BROADCAST...)
4) sendto()
I suspect my problem is in the server, around parts 5-8...or maybe 1. Any help or ideas would be greatly appreciated. Thanks!!
Another noteworthy issue that may or may not be related: There's an existing IPv4 UDP system which I'm porting, but is still active in the code I'm debugging. As I understand it, that won't be a conflict. Anyway, if I run the client & server on the same machine, Wireshark sees the IPv4 message from the client, but not the IPv6 message. However, if I run the client on a different machine on the same subnet, it sees both IPv4 & IPv6.
I'd be happy to post code snippets if that's necessary, but if someone wanted to give me a bullet list of what to do where, that's be easier for me and probably faster for you.
Thanks in advance for your help!
Edit: Maybe it'd help if I gave a quick rundown of what calls I make. I'll strip out the unnecessary details.
Server:
1) getaddrinfo(null, myPort,...) using hints containing AI_PASSIVE, AF_INET6, SOCK_DGRAM & IPPROTO_UDP
2) socket() on result of #1
3) setsockopt(hSocket, SOL_SOCKET, SO_REUSEADDR...)
4) bind()
5) getaddrinfo("FF1E::FFFF", null...) no hints here
6) create a ipv6_mreq
7) set mreq's address to the result of #5, set interface to 0
8) setsockopt(...IPPROTO_IPV6, IPV6_JOIN_GROUP, mreq...)
After #8, I create an event, which would be fired upon receipt of a message, but it never happens.
Client:
1) getaddrinfo(null, myPort...) using hints containing AF_INET6 & SOCK_DGRAM
2) socket() on result of #1
3) setsockopt(hSocket, SOL_SOCKET, SO_BROADCAST...)
4) sendto()
I suspect my problem is in the server, around parts 5-8...or maybe 1. Any help or ideas would be greatly appreciated. Thanks!!