none
Windows 2012 R2, "Teredo Interface" and "getaddrinfo" compatibility issue

    Question

  • One of our production is planned to support Windows 2012 R2, but there is something tricky about "Teredo Interface" on Windows 2012 R2.

    The logic of our code is like this:

    From system call "getaddrinfo", we can get the "IPv4 & IPv6" linked list, if any IPv4/IPv6 in this linked list can be connected, we will use this IPv4/IPv6 to communicate.  

    This part code can work on Windows 2k8 R2, but sometimes(not 100%) cannot work  on  Windows 2012 R2, the reason is :

    1)On Windows 2k8 R2, system call "getaddrinfo" doesn't return "Teredo Tunneling IPv6" or "ISATAP Tunneling IPv6".

       But On Windows 2012 R2, system call "getaddrinfo" will return "Teredo Tunneling IPv6" and "ISTAP Tunneling IPv6" .

    2) On Windows 2k8 R2, "Teredo Tunneling Interface" is always up  no matter "Windows Firewall" is enabled or disabled.

        But on Windows 2012 R2, "Teredo Tunneling Interface" is up and down intermittently when "Windows Firewall" is disabled,    but "Teredo Tunneling Interface" will be up all the time when "Windows Firewall" is enabled.

    There is  a chance, "getaddrinfo" return "Teredo Interface IPv6" as first item of the linked list, and it can be connected but not stable when "Windows Firewall" is disabled.

    We encounter this.

    My question is :

    1)Will "getaddrinfo" keep the same behavior  as Windows 2012 R2 in future release or service pack?

    2) Is there a way to exclude "Teredo IPv6" or make it as tail of the linked list when call "getaddrinfo"?

    3)Why "Teredo Interface" on Windows 2012 R2 depends on "Windows Firewall",    but Windows 2k8 R2 has a different behavor?

       Customer may disable "Windows Firewall".

    Thanks and Regards

    -Robin

    ------------------------------------------------------------------------------------------------------------------------------------------

    Test:

    1."getaddrinfo" test

    Test code is from MSDN "getaddrinfo" manual example, the code calls "getaddrinfo" and print the returned IPv4/IPv6 address lists.

    Compiler is VS 2010, and the compiled binary is named "addrinfo.exe".

    The usage of this tool is "addrinfo.exe <hostname> <port number>".

    1.1 On Windows 2k8 R2

    "ipconfig /all":

    Windows IP Configuration

        Host Name . . . . . . . . . . . . : nbu224

       Primary Dns Suffix  . . . . . . . : com

       Node Type . . . . . . . . . . . . : Hybrid

       ...

       DNS Suffix Search List. . . . . . : com

    Ethernet adapter Local Area Connection:

       Connection-specific DNS Suffix  . :

       Description . . . . . . . . . . . : Intel(R) PRO/1000 MT Network Connection

       ...

       Link-local IPv6 Address . . . . . : fe80::50c2:4c88:6435:ed60%11(Preferred)

       IPv4 Address. . . . . . . . . . . : 10.200.146.224(Preferred)

       Subnet Mask . . . . . . . . . . . : 255.255.255.0

       ...

       DNS Servers . . . . . . . . . . . : 143.127.251.102

                                                        143.127.160.5

       NetBIOS over Tcpip. . . . . . . . : Enabled

    Tunnel adapter isatap.{FFE7A1F7-E253-4DD4-A93D-AFA166428967}:

       Connection-specific DNS Suffix  . :

       Description . . . . . . . . . . . : Microsoft ISATAP Adapter

       ...

       Link-local IPv6 Address . . . . . : fe80::5efe:10.200.146.224%12(Preferred)

      ...

    Tunnel adapter Local Area Connection* 9:

       Connection-specific DNS Suffix  . :

       Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface

       ...

       IPv6 Address. . . . . . . . . . . : 2001:0:9d38:6abd:1053:5c8:f537:6d1f(Preferred)

       Link-local IPv6 Address . . . . . : fe80::1053:5c8:f537:6d1f%13(Preferred)

      ...

    From "addrinfo.exe nbu224 10082", we can see  " ISATAP Tunneling IPv6" and "Teredo Tunneling IPv6" are not returned:

    Calling getaddrinfo with following parameters:

                    nodename = nbu224

                    servname (or port) = 10082

    getaddrinfo returned success

    getaddrinfo response 1

                    Flags: 0x0

                    Family: AF_INET (IPv4)

                    IPv4 address 10.200.146.224

                    Socket type: SOCK_STREAM (stream)

                    Protocol: IPPROTO_TCP (TCP)

                    Length of this sockaddr: 16

                    Canonical name: (null)

    1.2 On Windows 2012 R2

    "ipconfig /all":

    Windows IP Configuration

        Host Name . . . . . . . . . . . . : i201-eng160

       Primary Dns Suffix  . . . . . . . : cdimglab.net

       Node Type . . . . . . . . . . . . : Hybrid

       ...

       DNS Suffix Search List. . . . . . : cdimglab.net

    Ethernet adapter Ethernet:

       Connection-specific DNS Suffix  . :

       Description . . . . . . . . . . . : Intel(R) 82574L Gigabit Network Connection

       ...

       IPv4 Address. . . . . . . . . . . : 10.200.160.201(Preferred)

       Subnet Mask . . . . . . . . . . . : 255.255.252.0

       Default Gateway . . . . . . . . . : 10.200.160.1

       DNS Servers . . . . . . . . . . . : 10.200.190.56

                                                        10.198.88.18

       NetBIOS over Tcpip. . . . . . . . : Enabled

    Tunnel adapter isatap.{B560368D-7B96-466A-89FD-B3933792A9D1}:

       Media State . . . . . . . . . . . : Media disconnected

       Connection-specific DNS Suffix  . :

       Description . . . . . . . . . . . : Microsoft ISATAP Adapter

       Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0

       DHCP Enabled. . . . . . . . . . . : No

       Autoconfiguration Enabled . . . . : Yes

    Tunnel adapter Local Area Connection* 12:

       Connection-specific DNS Suffix  . :

       Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface

       Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0

       DHCP Enabled. . . . . . . . . . . : No

       Autoconfiguration Enabled . . . . : Yes

       IPv6 Address. . . . . . . . . . . : 2001:0:9d38:6ab8:281f:e14:f537:5f36(Preferred)

       Link-local IPv6 Address . . . . . : fe80::281f:e14:f537:5f36%14(Preferred)

       ...

       NetBIOS over Tcpip. . . . . . . . : Disabled

    From "addinfo.exe i201-eng160 10082", we can see "Teredo Tunneling IPv6" is returned as the 1st item in address list(we do not have "ISATAP Tunneling" configuration on this machine):

    Calling getaddrinfo with following parameters:

                    nodename = i201-eng160

                    servname (or port) = 10082

    getaddrinfo returned success

    getaddrinfo response 1

                    Flags: 0x0

                    Family: AF_INET6 (IPv6)

                    IPv6 address [fe80::24df:372f:f537:5f36%14]:10082

                    Socket type: SOCK_STREAM (stream)

                    Protocol: IPPROTO_TCP (TCP)

                    Length of this sockaddr: 28

                    Canonical name: (null)

    getaddrinfo response 2

                    Flags: 0x0

                    Family: AF_INET (IPv4)

                    IPv4 address 10.200.160.201

                    Socket type: SOCK_STREAM (stream)

                    Protocol: IPPROTO_TCP (TCP)

                    Length of this sockaddr: 16

                    Canonical name: (null)

    getaddrinfo response 3

                    Flags: 0x0

                    Family: AF_INET6 (IPv6)

                    IPv6 address [2001:0:9d38:6ab8:24df:372f:f537:5f36]:10082

                    Socket type: SOCK_STREAM (stream)

                    Protocol: IPPROTO_TCP (TCP)

                    Length of this sockaddr: 28

                    Canonical name: (null)

    2. Teredo Tunneling" stability test

    2.1  On Windows 2k8 R2

    Disable "Windows Firewall", "ping  <Teredo Tunneling IPv6>" for several hours, no packet loss.

    Enable "Windows Firewall", "ping  <Teredo Tunneling IPv6>" for several hours, no packet loss.

    2.2 On Windows 2012 R2

    Disable "Windows Firewall", "ping  <Teredo Tunneling IPv6>" for several hours, more than 70% packet loss(up and down intermittently), so the IPv6 address will change(From the RFC, it is the right behavior).

    Enable "Windows Firewall", "ping  <Teredo Tunneling IPv6>" for several hours, no packet loss.

    Friday, May 16, 2014 9:00 AM

All replies

  • Hi Robin,

    Welcome to msdn forum.

    This forum is to discuss problems of Application Compatibility for Windows Desktop Development . Your question is not related to the topic of this forum.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, May 19, 2014 2:40 AM
  • Then could you  please help to forward my Question to the right forum?

    I asked this question at 2 forums, but both told me, it is not the right forum...

    Monday, May 19, 2014 7:38 AM