Hello,

Please help! I am quite new to network programming and so I tested out a sample client-Server application. The TCP or UDP client is either setup as eitHello,

Please help! I am quite new to network programming and so I tested out a sample client-Server application. The TCP or UDP client is either setup as either IPv6 or IPv4, depending on the server address type input by the user on a command line. The server has 4 sockets, one each for TCP/IPv6, TCP/IPv4, UDP/IPv6, UDP/IPv4. There is no router on this network, and the two platforms are on the same link

The client is able to communicate with the server in following combinations:

1) Client TCP IPv4, Server IPv4
2) Client UDP IPv4, Server IPv4
3) Client TCP IPv6, Server IPv4 using IPv6 mapped IPv4 address
4) Client UDP IPv6, Server IPv4 using IPv6 mapped IPv4 address
5) Client TCP IPv6, Server IPv6 both on same plaforms
6) Client UDP IPv6, Server IPv6 both on same plaforms

However, the following does not work is client and server are on diffent platforms
1) Client TCP IPv6, Server IPv6
2) Client UDP IPv6, Server IPv6

However, the application has a problem connecting. The tracedump6 shows the ICMPv6 message indicating “Destination unreachable”, “Unreachable address”.

The ping6 command from client to server platform works fine. I am at a deadend.

Following are some of the information for debugging. Will appreciate any help I can get in fixing this problem.

>>>>>>>>>>>>>>ifconfig on server platform >>>>>>>>>>>>>>>>>>>>>>>>>

[root@ses3 nitl]# /sbin/ifconfig

eth1 Link encap:Ethernet HWaddr 00:1A:A0:00:EB:25
inet addr:10.0.2.21 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::21a:a0ff:fe00:eb25/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:839105 errors:0 dropped:0 overruns:0 frame:0
TX packets:458266 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:97565438 (93.0 MiB) TX bytes:137009860 (130.6 MiB)
Interrupt:185

eth1:1 Link encap:Ethernet HWaddr 00:1A:A0:00:EB:25
inet addr:192.168.1.87 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:185

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:13725 errors:0 dropped:0 overruns:0 frame:0
TX packets:13725 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7644451 (7.2 MiB) TX bytes:7644451 (7.2 MiB)


>>>>>>>>>>>>>>ifconfig on client platform >>>>>>>>>>>>>>>>>>>>>>>>>
root@ses3 Mixed_IPv6_IPv4]# /sbin/ifconfig
eth1 Link encap:Ethernet HWaddr 00:1A:A0:00:EB:11
inet addr:10.0.2.29 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::21a:a0ff:fe00:eb11/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:760 errors:0 dropped:0 overruns:0 frame:0
TX packets:372 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:93037 (90.8 KiB) TX bytes:49082 (47.9 KiB)
Interrupt:185

eth1:1 Link encap:Ethernet HWaddr 00:1A:A0:00:EB:11
inet addr:192.168.1.88 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:185

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:3460 errors:0 dropped:0 overruns:0 frame:0
TX packets:3460 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7997353 (7.6 MiB) TX bytes:7997353 (7.6 MiB)

>>>>>>>>>>>>>>>>> IPv4 route command from client platform >>>>>>>>>>>>

[root@ses3 nitl]# /sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.2.0 * 255.255.255.0 U 0 0 0 eth1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth1


>>>>>>>>>>>>> IPv6 traceroute command from client to server platform across interface eth1 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>

[root@ses3 nitl]# traceroute -i eth1 fe80::21a:a0ff:fe00:eb25

traceroute to fe80::21a:a0ff:fe00:eb25 (fe80::21a:a0ff:fe00:eb25), 30 hops max, 40 byte packets

1 fe80::21a:a0ff:fe00:eb25%eth1 (fe80::21a:a0ff:fe00:eb25) 5.037 ms 0.280 ms 0.126 ms

>>>>>>>ping6 from client to server platform across interface eth1 >>>>>>>
[root@ses3 Mixed_IPv6_IPv4]# ping6 -I eth1 fe80::21a:a0ff:fe00:eb25

PING fe80::21a:a0ff:fe00:eb25(fe80::21a:a0ff:fe00:eb25) from fe80::21a:a0ff:fe00:eb11 eth1: 56 data bytes
64 bytes from fe80::21a:a0ff:fe00:eb25: icmp_seq=0 ttl=64 time=4.59 ms
64 bytes from fe80::21a:a0ff:fe00:eb25: icmp_seq=1 ttl=64 time=0.148 ms
64 bytes from fe80::21a:a0ff:fe00:eb25: icmp_seq=2 ttl=64 time=0.130 ms
64 bytes from fe80::21a:a0ff:fe00:eb25: icmp_seq=3 ttl=64 time=0.130 ms



>>>>>>>>>>>>> Run Server application which sets up sockets for TCP/UDP IP4 and IPv6 on platform fe80::21a:a0ff:fe00:eb25, port daytime (ie 13)>>>>>>>>>

[root@ses2 Mixed_IPv6_IPv4]# ./testserver -v daytime

Setting up a passive socket based on the following address info:
ai_flags = 0x01
ai_family = 10 (PF_INET = 2, PF_INET6 = 10)
ai_socktype = 1 (SOCK_STREAM = 1, SOCK_DGRAM = 2)
ai_protocol = 6 (IPPROTO_TCP = 6, IPPROTO_UDP = 17)
ai_addrlen = 28 (sockaddr_in = 16, sockaddr_in6 = 2
ai_addr = sin6_family: 10 (AF_INET = 2, AF_INET6 = 10)
sin6_addr: ::
sin6_port: 13
sin6_flowinfo: 0
sin6_scope_id: 0

Setting up a passive socket based on the following address info:
ai_flags = 0x01
ai_family = 2 (PF_INET = 2, PF_INET6 = 10)
ai_socktype = 1 (SOCK_STREAM = 1, SOCK_DGRAM = 2)
ai_protocol = 6 (IPPROTO_TCP = 6, IPPROTO_UDP = 17)
ai_addrlen = 16 (sockaddr_in = 16, sockaddr_in6 = 2
ai_addr = sin_family: 2 (AF_INET = 2, AF_INET6 = 10)
sin_addr: 0.0.0.0
sin_port: 13

Setting up a passive socket based on the following address info:
ai_flags = 0x01
ai_family = 10 (PF_INET = 2, PF_INET6 = 10)
ai_socktype = 2 (SOCK_STREAM = 1, SOCK_DGRAM = 2)
ai_protocol = 17 (IPPROTO_TCP = 6, IPPROTO_UDP = 17)
ai_addrlen = 28 (sockaddr_in = 16, sockaddr_in6 = 2
ai_addr = sin6_family: 10 (AF_INET = 2, AF_INET6 = 10)
sin6_addr: ::
sin6_port: 13
sin6_flowinfo: 0
sin6_scope_id: 0

Setting up a passive socket based on the following address info:
ai_flags = 0x01
ai_family = 2 (PF_INET = 2, PF_INET6 = 10)
ai_socktype = 2 (SOCK_STREAM = 1, SOCK_DGRAM = 2)
ai_protocol = 17 (IPPROTO_TCP = 6, IPPROTO_UDP = 17)
ai_addrlen = 16 (sockaddr_in = 16, sockaddr_in6 = 2
ai_addr = sin_family: 2 (AF_INET = 2, AF_INET6 = 10)
sin_addr: 0.0.0.0
sin_port: 13



>>>>>>>>>>>>> Run IPv6 client on platform fe80::21a:a0ff:fe00:eb11, interface eth1, specifying server platform fe80::21a:a0ff:fe00:eb25 and server port as daytime (ie port 13) >>>>>>>>>>>>>>>>>>>>>>>>>>

[root@ses3 Mixed_IPv6_IPv4]# ./testtcpclient -v -s eth1 fe80::21a:a0ff:fe00:eb25 daytime

Address info:
ai_flags = 0x00
ai_family = 10 (PF_INET = 2, PF_INET6 = 10)
ai_socktype = 1 (SOCK_STREAM = 1, SOCK_DGRAM = 2)
ai_protocol = 6 (IPPROTO_TCP = 6, IPPROTO_UDP = 17)
ai_addrlen = 28 (sockaddr_in = 16, sockaddr_in6 = 28
ai_addr = sin6_family: 10 (AF_INET = 2, AF_INET6 = 10)
sin6_addr: fe80::21a:a0ff:fe00:eb25%eth1
sin6_port: 13
sin6_flowinfo: 0
sin6_scope_id: 3
testtcpclient (line 399): System call failed ('connect') - No route to host.
testtcpclient: Sorry... a connection could not be established.


>>>>>>>>>>>>tcpdump on server platform : fe80::21a:a0ff:fe00:eb25 >>>>>>[root@ses2 Mixed_IPv6_IPv4]# /usr/sbin/tcpdump -t -n -i eth1 -s 512 -vv ip6
tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 512 bytes

IP6 (hlim 255, next-header: ICMPv6 (58 , length: 32) fe80::21a:a0ff:fe00:eb11 >
ff02::1:ff00:eb25: [icmp6 sum ok] ICMP6, neighbor solicitation, length 32, who has fe80::21a:a0ff:fe00:eb25
source link-address option (1), length 8 (1): 00:1a:a0:00:eb:11
0x0000: 001a a000 eb11

IP6 (hlim 255, next-header: ICMPv6 (58 , length: 32) fe80::21a:a0ff:fe00:eb25 >
fe80::21a:a0ff:fe00:eb11: [icmp6 sum ok] ICMP6, neighbor advertisement, length 32,tgt is fe80::21a:a0ff:fe00:eb25, Flags [solicited, override]destination link-address option (2), length 8 (1): 00:1a:a0:00:eb:25
0x0000: 001a a000 eb25

IP6 (hlim 64, next-header: TCP (6), length: 40) fe80::21a:a0ff:fe00:eb11.51541 >
fe80::21a:a0ff:fe00:eb25.daytime: S, cksum 0x0243 (correct),
343805471:343805471(0) win 5760 <mss1440,sackOK,timestamp 352458977 0,nop,wscale 7>

IP6 (hlim 64, next-header: ICMPv6 (58, length:88] fe80::21a:a0ff:fe00:eb25 >
fe80::21a:a0ff:fe00:eb11: [icmp6 sum ok] ICMP6, destination unreachable, length 88, unreachable address fe80::21a:a0ff:fe00:eb25

IP6 (hlim 255, next-header: ICMPv6 (58, length: 32) fe80::21a:a0ff:fe00:eb25 >
fe80::21a:a0ff:fe00:eb11: [icmp6 sum ok] ICMP6, neighbor solicitation, length 32, who has fe80::21a:a0ff:fe00:eb11
source link-address option (1), length 8 (1): 00:1a:a0:00:eb:25
0x0000: 001a a000 eb25

IP6 (hlim 255, next-header: ICMPv6 (58, length: 24) fe80::21a:a0ff:fe00:eb11 >
fe80::21a:a0ff:fe00:eb25: [icmp6 sum ok] ICMP6, neighbor advertisement, length 24, tgt is fe80::21a:a0ff:fe00:eb11, Flags [solicited]
**************** using IPv6 address families on client ************
[root@ses3 Mixed_IPv6_IPv4]# /sbin/route -A inet6
Kernel IPv6 routing table
Destination Next Hop Flags Metric Ref Use Iface
ses3/128 * U 0 252 1 lo
getnameinfo failed
[UNKNOWN]/128 * U 0 14 1 lo
getnameinfo failed
[UNKNOWN]/64 * U 1 0 0 eth1
getnameinfo failed
[UNKNOWN]/64 * U 256 0 0 eth1
getnameinfo failed
[UNKNOWN]/8 * U 256 0 0 eth1


[root@ses3 Mixed_IPv6_IPv4]# netstat -A inet6 -rnv
Kernel IPv6 routing table
Destination Next Hop Flags Metric Ref Use Iface
::1/128 :: U 0 252 1 lo
fe80::21a:a0ff:fe00:eb11/128 :: U 0 14 1 lo
fe80::/64 :: U 1 0 0 eth1
fe80::/64 :: U 256 0 0 eth1
ff00::/8 :: U 256 0 0 eth1

*************** IPv4 address family on client **********
[root@ses3 Mixed_IPv6_IPv4]# netstat -A inet -rnv
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1

[root@ses3 Mixed_IPv6_IPv4]# /sbin/route -A inet
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
10.0.2.0 * 255.255.255.0 U 0 0 0 eth1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1


****** IPv6 address family on server **************
[root@ses2 Mixed_IPv6_IPv4]# netstat -A inet6 -rnv
Kernel IPv6 routing table
Destination Next Hop Flags Metric Ref Use Iface
::1/128 :: U 0 591 1 lo
fe80::21a:a0ff:fe00:eb25/128 :: U 0 1041 1 lo
fe80::/64 :: U 256 0 0 eth1
ff00::/8 :: U 256 0 0 eth1

[root@ses2 Mixed_IPv6_IPv4]# /sbin/route -A inet6
Kernel IPv6 routing table
Destination Next Hop Flags Metric Ref Use Iface
ses2/128 * U 0 591 1 lo
fe80::21a:a0ff:fe00:eb25/128 * U 0 1041 1 lo
fe80::/64 * U 256 0 0 eth1
ff00::/8 * U 256 0 0 eth1


************** IPv4 address family on server *********
[root@ses1 nitl]# /sbin/route -A inet
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1

[root@ses1 nitl]# netstat -A inet -rnv
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1