Sending IPv6 packets

Discussion to talk about software related topics only.
User avatar
pbreed
Posts: 1080
Joined: Thu Apr 24, 2008 3:58 pm

Re: Sending IPv6 packets

Post by pbreed »

First IPV6 doe snto EVER send broadcasts...
It just can't.

It can send multicasts....
Your PC must register to receive multicasts, otherwise they are thrown away at the mac filtering layer of the NIC.

Google:

ipv6 broadcast

You'll see lots of stuff....
You must register to listen on specific multicast addresses....
SeeCwriter
Posts: 606
Joined: Mon May 12, 2008 10:55 am

Re: Sending IPv6 packets

Post by SeeCwriter »

I understand that the IPv6 does not send broadcasts, only multicasts. And what you said makes sense. But then how does Neighbor Solicitation and Advertisement work since those functions, as I understand it, are to determine what other hosts are on the subnet? You can't register to receive a multicast address that you don't know about.
sulliwk06
Posts: 118
Joined: Tue Sep 17, 2013 7:14 am

Re: Sending IPv6 packets

Post by sulliwk06 »

It looks like there are some standardized multicast addresses for IPv6

ff02::1 All nodes on the local network segment
ff02::2 All routers on the local network segment
ff02::5 OSPFv3 All SPF routers
ff02::6 OSPFv3 All DR routers
ff02::8 IS-IS for IPv6 routers
ff02::9 RIP routers
ff02::a EIGRP routers
ff02::d PIM routers
ff02::16 MLDv2 reports (defined in RFC 3810)
ff02::1:2 All DHCP servers and relay agents on the local network segment (defined in RFC 3315)
ff02::1:3 All LLMNR hosts on the local network segment (defined in RFC 4795)
ff05::1:3 All DHCP servers on the local network site (defined in RFC 3315)
ff0x::c Simple Service Discovery Protocol
ff0x::fb Multicast DNS
ff0x::101 Network Time Protocol
ff0x::108 Network Information Service
ff0x::181 Precision Time Protocol (PTP) version 2 messages (Sync, Announce, etc.) except peer delay measurement
ff02::6b Precision Time Protocol (PTP) version 2 peer delay measurement messages
ff0x::114 Used for experiments


https://en.wikipedia.org/wiki/Multicast_address
look under "Well-known IPv6 multicast addresses"
SeeCwriter
Posts: 606
Joined: Mon May 12, 2008 10:55 am

Re: Sending IPv6 packets

Post by SeeCwriter »

Using the example program IPv6-DHCPv6 I posted above, one of the ip addresses I used was "ff0::1". Yet wireshark does not capture any packets to that address.
SeeCwriter
Posts: 606
Joined: Mon May 12, 2008 10:55 am

Re: Sending IPv6 packets

Post by SeeCwriter »

I tried the following and also was not able to capture any activity from the NB module on wireshark.
First I tried sending to the IPv4 broadcast address using the IPV4-Mapped IPv6 Address method defined in RFC4291. Nothing.
Then I tried sending a packet to my PC's IPv4 address using the same IPV4-Mapped IPv6 Address method. Nothing.
Then I tried sending an IPv6 packet to the link-local address of my PC. Nothing.
And sending to multicast address ff02::1 is still not captured by wireshark.
Clearly there's something I'm not understanding. I've read, and continue to read, through RFCs 2373, 3306,3307, 2374, 4291, 4038, 4861, 4443, to no avail.

Code: Select all

void UdpSend( char *buf, int len, IPADDR &ip, WORD port )
{
  bool isip6 = !ip.IsEmbeddedIPV4();

  iprintf("IsIPv6: %d\r\n", isip6);

  UDPPacket pkt(isip6);
  pkt.SetDestinationPort(port);
  pkt.SetSourcePort(port);
  pkt.AddData((BYTE *)buf, (WORD) len);  
  pkt.Send(ip);
}

void UserMain( void * pd )
{
    initWithWeb();
    char buf[] = { "Hello World" };

    IPADDR6 ip6adr;
    ip6adr.SetFromAscii( "255.255.255.255" );
    //ip6adr.SetFromAscii( "10.250.5.59" );		// My PC's IPv4 address

    //IPADDR6 ip6adr = IPADDR6::AsciiToIp6( "fe80::b4f3:189:71e9:3b56", false );	// My PC's IPv6 address.
   
    siprintf(DHCPNameBuffer,
            "%s_%s_%02X%02X%02X",
            "NB",
            PlatformName,
            gConfigRec.mac_address[3],
            gConfigRec.mac_address[4],
            gConfigRec.mac_address[5]
            );
    iprintf("OfferName: %s\n", DHCPNameBuffer);
    pDHCPOfferName = DHCPNameBuffer;

    // set our callbacks
    NB::V6::DHCPv6::pAddOROCB = AddORO;
    NB::V6::DHCPv6::pRequestOptionCB = AddSendOption;
    NB::V6::DHCPv6::pReplyCB = GetReply;

    EnableSmartTraps();

    iprintf("Application: %s\r\nNNDK Revision: %s\r\n",AppName,GetReleaseTag());
    while(1) {
        showIpAddresses();
        iprintf("\r\nType any key to display address information\r\n");
        iprintf("Note that routable addresses may take a few seconds to receive\r\n");
        getchar();
        iprintf("\r\n\r\n");
        puts("Sending...");
        UdpSend(buf, (int) strlen(buf), ip6adr, 2100);
        puts("Done.");
    }
}
User avatar
pbreed
Posts: 1080
Joined: Thu Apr 24, 2008 3:58 pm

Re: Sending IPv6 packets

Post by pbreed »

I'm 90% sure this is your PC's network interface card, filtering packets before you ever see them....

I'd start by using the find6.py as a template to setup to listen on some of the IPV6 multicast sockets.
(other than the one netburner uses for IPV6 find)

This will tell you NIC to accept/allow those addresses into your PC.
I'd also see if wire shark has a promiscuous setting for that interface card.

Then I'd send//receive on these sockets and see what happens..
Post Reply