Networking Forums

Networking Forums > Computer Networking > Linux Networking > MAC address of an IPv6 address

Reply
Thread Tools Display Modes

MAC address of an IPv6 address

 
 
Jigs
Guest
Posts: n/a

 
      04-10-2007, 08:34 PM
Hi All,

I am writing a program that tests the health of a NIC card. I am
creating a NDD socket (Data Link Access) which I will use to send ICMP
ECHO packets to a given host. This means that my application has to
build the entire packet and I have to create and add the IP/IPv6,
ICMP/
6, and MAC headers in my application. I got things to work for IP, but
I am stuck with IPv6:

1) How do I find the MAC address for an IPv6 remote host? For IP, I
use the SIOCGARP ioctl and get the MAC adress from the ARP cache. But
IPv6 does not use ARP. there is something called neighbor discovery
for IPv6, but I could not find any programatic interface to use it ..

2) How do I do a broadcast ping in IPv6? In v4, I just put the
broadcast address in the destination addr fiend of the IP header and
things worked, but what do I do for v6?

Thanks in advance for your help.

Jigs

 
Reply With Quote
 
 
 
 
SadOldGit
Guest
Posts: n/a

 
      04-11-2007, 12:06 AM
Jigs wrote:
> Hi All,
> [snip]

ping6 ?
>
> 2) How do I do a broadcast ping in IPv6? In v4, I just put the
> broadcast address in the destination addr fiend of the IP header and
> things worked, but what do I do for v6?


MAC address is part of the IPv6 address - no more ARP!

>
> Thanks in advance for your help.
>
> Jigs
>

Steve
 
Reply With Quote
 
Hans
Guest
Posts: n/a

 
      04-11-2007, 02:20 PM
SadOldGit wrote:
> Jigs wrote:
>> Hi All,
>> [snip]

> ping6 ?
>> 2) How do I do a broadcast ping in IPv6? In v4, I just put the
>> broadcast address in the destination addr fiend of the IP header and
>> things worked, but what do I do for v6?

>
> MAC address is part of the IPv6 address - no more ARP!


When jou set the ip address manually it is not.

--
Hans
 
Reply With Quote
 
SadOldGit
Guest
Posts: n/a

 
      04-11-2007, 10:42 PM
Hans wrote:
> SadOldGit wrote:
>> Jigs wrote:
>>> Hi All,
>>> [snip]

>> ping6 ?
>>> 2) How do I do a broadcast ping in IPv6? In v4, I just put the
>>> broadcast address in the destination addr fiend of the IP header and
>>> things worked, but what do I do for v6?

>>
>> MAC address is part of the IPv6 address - no more ARP!

>
> When jou set the ip address manually it is not.
>


"When IEEE 802 48bit MAC addresses are available (on an interface or a
node), an implementation should use them to create interface
identifiers due to their availability and uniqueness properties."
RFC2373

OK, it doesn't say must!
 
Reply With Quote
 
Hans
Guest
Posts: n/a

 
      04-12-2007, 08:59 PM
SadOldGit wrote:
> Hans wrote:
>> SadOldGit wrote:
>>> Jigs wrote:
>>>> Hi All,
>>>> [snip]
>>> ping6 ?
>>>> 2) How do I do a broadcast ping in IPv6? In v4, I just put the
>>>> broadcast address in the destination addr fiend of the IP header and
>>>> things worked, but what do I do for v6?
>>> MAC address is part of the IPv6 address - no more ARP!

>> When jou set the ip address manually it is not.
>>

>
> "When IEEE 802 48bit MAC addresses are available (on an interface or a
> node), an implementation should use them to create interface
> identifiers due to their availability and uniqueness properties."
> RFC2373
>
> OK, it doesn't say must!


Should is almost must. By the way:

bash-3.1# ip addr -6 show dev eth0
2: eth0: <BROADCAST,MULTICAST,NOTRAILERS,UP,10000> mtu 1500 qdisc
pfifo_fast qlen 1000
link/ether 00:11:43:61:8d:db brd ff:ff:ff:ff:ff:ff
inet6 2001:888:1639::4/48 scope global
valid_lft forever preferred_lft forever
inet6 fe80::211:43ff:fe61:8ddb/64 scope link
valid_lft forever preferred_lft forever
bash-3.1#

The global scope is mac-free, but the scope link is not. And on another
pc of mine every bridge-port (except eth3) seems to have its own ip6
addr whether i like it or not:

bash-3.1# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.003018a54f01 no eth0
eth1
eth2
eth3
bash-3.1# ip -6 addr show
1: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qlen 1000
inet6 fe80::230:18ff:fea5:ebfd/64 scope link
valid_lft forever preferred_lft forever
2: lo: <LOOPBACK,UP,10000> mtu 16436
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qlen 1000
inet6 fe80::230:18ff:fea5:4f01/64 scope link
valid_lft forever preferred_lft forever
4: eth2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qlen 1000
inet6 fe80::230:18ff:fea5:4f02/64 scope link
valid_lft forever preferred_lft forever
7: br0: <BROADCAST,MULTICAST,UP,10000> mtu 1500
inet6 2001:888:1639::2/48 scope global
valid_lft forever preferred_lft forever
inet6 fe80::230:18ff:fea5:4f01/64 scope link
valid_lft forever preferred_lft forever

--
Hans


 
Reply With Quote
 
SadOldGit
Guest
Posts: n/a

 
      04-13-2007, 12:00 AM
Hans wrote:
> SadOldGit wrote:
>> Hans wrote:
>>> SadOldGit wrote:
>>>> Jigs wrote:
>>>>> Hi All,
>>>>> [snip]
>>>> ping6 ?
>>>>> 2) How do I do a broadcast ping in IPv6? In v4, I just put the
>>>>> broadcast address in the destination addr fiend of the IP header and
>>>>> things worked, but what do I do for v6?
>>>> MAC address is part of the IPv6 address - no more ARP!
>>> When jou set the ip address manually it is not.
>>>

>>
>> "When IEEE 802 48bit MAC addresses are available (on an interface or a
>> node), an implementation should use them to create interface
>> identifiers due to their availability and uniqueness properties."
>> RFC2373
>>
>> OK, it doesn't say must!

>
> Should is almost must. By the way:
>
> bash-3.1# ip addr -6 show dev eth0
> 2: eth0: <BROADCAST,MULTICAST,NOTRAILERS,UP,10000> mtu 1500 qdisc
> pfifo_fast qlen 1000
> link/ether 00:11:43:61:8d:db brd ff:ff:ff:ff:ff:ff
> inet6 2001:888:1639::4/48 scope global
> valid_lft forever preferred_lft forever
> inet6 fe80::211:43ff:fe61:8ddb/64 scope link
> valid_lft forever preferred_lft forever
> bash-3.1#
>
> The global scope is mac-free, but the scope link is not. And on another
> pc of mine every bridge-port (except eth3) seems to have its own ip6
> addr whether i like it or not:
>
> bash-3.1# brctl show
> bridge name bridge id STP enabled interfaces
> br0 8000.003018a54f01 no eth0
> eth1
> eth2
> eth3
> bash-3.1# ip -6 addr show
> 1: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qlen 1000
> inet6 fe80::230:18ff:fea5:ebfd/64 scope link
> valid_lft forever preferred_lft forever
> 2: lo: <LOOPBACK,UP,10000> mtu 16436
> inet6 ::1/128 scope host
> valid_lft forever preferred_lft forever
> 3: eth1: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qlen 1000
> inet6 fe80::230:18ff:fea5:4f01/64 scope link
> valid_lft forever preferred_lft forever
> 4: eth2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qlen 1000
> inet6 fe80::230:18ff:fea5:4f02/64 scope link
> valid_lft forever preferred_lft forever
> 7: br0: <BROADCAST,MULTICAST,UP,10000> mtu 1500
> inet6 2001:888:1639::2/48 scope global
> valid_lft forever preferred_lft forever
> inet6 fe80::230:18ff:fea5:4f01/64 scope link
> valid_lft forever preferred_lft forever
>


Thanks Hans - I must check that out on mine
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IPv6 address not connecting but IPv4-mapped -IPv6 does. Please help. DanielJohnson Network Routers 0 01-07-2009 12:10 AM
ipv6 simple address rodchar Windows Networking 0 03-13-2008 01:14 AM
Command for assigning IPv6 address and MAC address on the interface iceman Linux Networking 7 03-03-2008 07:51 PM
IPv6 infrastructure for Global and/or Site Specific IPv6 address JackFlash Windows Networking 1 06-25-2007 03:11 PM
IPV6 ADDRESS configuration Suma Linux Networking 0 01-05-2006 12:54 PM



1 2 3 4 5 6 7 8 9 10 11