Thursday, July 7, 2011

BSD improve IPv6

Some continuation to the previous post:

Ping from host with code using mac addresses for gw (ipv6 addr fd00::3/128):
fd00::1 (linux host)
ping6 fd00::1
PING6(56=40+8+8 bytes) fd00::3 --> fd00::1
16 bytes from fd00::1, icmp_seq=0 hlim=64 time=4.047 ms
16 bytes from fd00::1, icmp_seq=1 hlim=64 time=1.792 ms
16 bytes from fd00::1, icmp_seq=2 hlim=64 time=0.795 ms
^C
--- fd00::1 ping6 statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.795/2.211/4.047/1.360 ms

fd00::4 (freebsd host running original code)
ping6 fd00::4
PING6(56=40+8+8 bytes) fd00::3 --> fd00::4
no response

tcpdump -nei re0 output on host with original code:
10:07:21.720560 00:01:00:00:00:04 > 33:33:00:00:00:6d, ethertype IPv6 (0x86dd), length 158: fd00::4.698 > ff02::6d.698: OLSR, seq 0xd218, length 96
10:07:21.909741 00:01:00:00:00:04 > 02:21:30:ca:dd:35, ethertype IPv4 (0x0800), length 114: 10.0.0.4.22 > 10.0.0.99.36085: Flags [P.], ack 49, win 8326, options [nop,nop,TS val 1136371185 ecr 2080490], length 48
10:07:21.910094 02:21:30:ca:dd:35 > 00:01:00:00:00:04, ethertype IPv4 (0x0800), length 66: 10.0.0.99.36085 > 10.0.0.4.22: Flags [.], ack 35472, win 1002, options [nop,nop,TS val 2080648 ecr 1136371185], length 0
10:07:21.974657 00:01:00:00:00:03 > 33:33:ff:00:00:04, ethertype IPv6 (0x86dd), length 86: fd00::3 > ff02::1:ff00:4: ICMP6, neighbor solicitation, who has fd00::4, length 32
10:07:22.014421 00:01:00:00:00:04 > 33:33:ff:00:00:03, ethertype IPv6 (0x86dd), length 86: fd00::4 > ff02::1:ff00:3: ICMP6, neighbor solicitation, who has fe80::3, length 32

So the original code, doesn't know where to send the answer for the ICMP request, that's why the other host doesn't receive anything.

Also, I tested and the code using lonklocal address, but adds only a default route works the same as the one using mac addresse, but I'm nt sure if it is the best.

No comments:

Post a Comment