Hi,
I checked the HITs and they are ok. If I first test host A as the server and host B as the client, it works fine. If I restart the hip daemon, and host A becomes the client and host B the server, it also works fine. However, if I switch them without restarting the daemon, it doesn't work. The new client can't find the server can keeps trying.
I've also noticed that when this problem occurs (the opposite connection), I can also stop the server and start the client that it won't receive an error message (as usual if I try in the correct side). It will keep trying to connect. Using tcpdump, I saw ESP messages from the client to the server.
This is the output of the client:
joaquina:/usr/local/hipl-1.0.0/test# ./conntest-client-gai ip6-torres tcp 5000 name='ip6-torres' service='5000' not IPv4 or IPv6 address, resolve name (!AI_NUMERICHOST) HIP_TRANSPARENT_API: fetch HIT addresses HIP_TRANSPARENT_API: AI_HIP set: do not get IPv6 addresses Dumping the structure AF_INET6 in6_addr=0x11 79 e9 99 88 69 23 66 6c cf 08 1e 2c d6 e0 a9 AF_INET in_addr=0x1d6e0a9 (1.214.224.169) AF_INET6 in6_addr=0x11 18 78 a5 0c 28 b0 39 75 bd 03 af 89 28 94 a8 AF_INET in_addr=0x12894a8 (1.40.148.168) AF_INET6 in6_addr=0x11 8c ae f5 e1 b1 35 03 3c f9 09 08 7f cf 91 42 AF_INET in_addr=0x1cf9142 (1.207.145.66) AF_INET6 in6_addr=0x11 59 87 c4 4b c1 97 cf 8e d9 5e 67 43 36 08 3f AF_INET in_addr=0x136083f (1.54.8.63) AF_INET6 in6_addr=0x3f fe 00 00 00 00 00 00 00 00 00 00 00 00 00 04 HIT: 1179:e999:8869:2366:6ccf:081e:2cd6:e0a9 IP: 3ffe:0000:0000:0000:0000:0000:0000:0004 waiting to receive deamon info 88 bytes received HIT: 1118:78a5:0c28:b039:75bd:03af:8928:94a8 IP: 3ffe:0000:0000:0000:0000:0000:0000:0004 waiting to receive deamon info 88 bytes received HIT: 118c:aef5:e1b1:3503:3cf9:0908:7fcf:9142 IP: 3ffe:0000:0000:0000:0000:0000:0000:0004 waiting to receive deamon info 88 bytes received HIT: 1159:87c4:4bc1:97cf:8ed9:5e67:4336:083f IP: 3ffe:0000:0000:0000:0000:0000:0000:0004 waiting to receive deamon info 88 bytes received HIP: AI_HIP set: remove IP addresses Dumping the structure after removing IP addreses AF_INET6 in6_addr=0x11 59 87 c4 4b c1 97 cf 8e d9 5e 67 43 36 08 3f Input some text, press enter and ctrl+d dsadsa !!!! conntest.c Connecting... before ai->ai_addr 110 0x0a00138800000000115987c44bc197cf8ed95e674336083f00000000e9000000306130303133383830303030303030303131353938376334346263313937636638656439356536373433333630383366303030303030303065393030303030303330363133303330333133333338 before ai->ai_addr sockaddr 0x0a00138800000000115987c44bc197cf before ai->ai_addr sockaddr_in6 0x0a00138800000000115987c44bc197cf8ed95e674336083f00000000 before ai_flags 0x000800000a000000 before ai_family 0x0a000000 before ai_socktype 0x01000000 before ai_protocol 0x06000000 before ai_addrlen 0x1c000000 ai_flags 2048 ai_family 10 ai_socktype 1 ai_protocol6 ai_addrlen 28 ai_canonname (null) ai->ai_addr 8813000a Trying to connect to 1159:87c4:4bc1:97cf:8ed9:5e67:4336:83f
And this is the output of tcpdump, without the patch:
joaquina:~# tcpdump -n -i any esp tcpdump: WARNING: Promiscuous mode not supported on the "any" device tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on any, link-type LINUX_SLL (Linux cooked), capture size 96 bytes 10:16:50.295981 3ffe::3 > 3ffe::4: ESP(spi=0x6e77880d,seq=0x10) 10:16:53.290637 3ffe::3 > 3ffe::4: ESP(spi=0x6e77880d,seq=0x11) 10:16:59.291046 3ffe::3 > 3ffe::4: ESP(spi=0x6e77880d,seq=0x12) 10:17:11.291774 3ffe::3 > 3ffe::4: ESP(spi=0x6e77880d,seq=0x13)
4 packets captured 4 packets received by filter 0 packets dropped by kernel
and this is the output of the daemon:
debug(debug.c:430@hip_print_hit): our hit: 118d:216e:7e78:4ae6:8a5a:8996:37a7:9875 debug(debug.c:430@hip_print_hit): peer hit: 1159:87c4:4bc1:97cf:8ed9:5e67:4336:083f debug(debug.c:430@hip_print_hit): our addr: 3ffe:0000:0000:0000:0000:0000:0000:0003 debug(debug.c:430@hip_print_hit): peer addr: 3ffe:0000:0000:0000:0000:0000:0000:0004 info(hadb.c:161@hip_hadb_find_byhits): hit is: 0x118d216e7e784ae68a5a899637a79875 info(hadb.c:162@hip_hadb_find_byhits): hit2 is: 0x115987c44bc197cf8ed95e674336083f info(hadb.c:163@hip_hadb_find_byhits): the computed key is: 0x00d4a6aa35b9dd290483d7f17491904a debug(hadb.c:44@hip_hadb_hold_entry): HA: 0x80a8028, refcnt incremented to: 2 error(hadb.c:277@hip_hadb_add_peer_info_complete): Ignoring new mapping, old one exists info(hidb.c:698@hip_for_each_hi): Found HIT:0x11b6ce60ff12002557f13b0b22a8021b debug(hadb.c:270@hip_hadb_add_peer_info_complete): CALLED hip_hadb_add_peer_info
Thanks for your attention,
Walter
On Mon, 14 Aug 2006, Miika Komu wrote:
> On Thu, 10 Aug 2006, Walter Wong wrote: > >> I tested the connection between two hosts using HIP and I had some >> problems. In the first test, I followed the instruction at chapter 6 >> in the manual and it worked fine for me. However, when I tried to do >> the same test, but switching the hosts (if A was the initiator, now A >> is server) it doesn't work. >> >> B, which is the initiator in the second test, just show a message >> >> Trying to connect to 111b:1b7:67ca:...... >> >> and halts. >> >> Am I missing anything? > > Sorry for the delay. Are you sure that configured the HITs correctly to > /etc/hip/hosts and also the IP addresses to /etc/hosts? > > What did hipd output?
In addition, what did "tcpdump -n -i any esp or proto 253 or port 50500" output?
-- Miika Komu http://www.iki.fi/miika/
-- Walter Wong E-mail:wong at dca.fee.unicamp.br School of Electrical and Computer Engineering - FEEC State University at Campinas - UNICAMP