Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

IPv6 対応アプリケーション開発なんて怖くない

6,399 views

Published on

Published in: Technology
  • Be the first to comment

IPv6 対応アプリケーション開発なんて怖くない

  1. 1. IPv6 : IAjapan Java Jun 11th, 2011 - OSC 2011 Hokkaido
  2. 2. • IPv6• IPv4• IPv6• Web IPv6 Jun 11th, 2011 - OSC 2011 Hokkaido
  3. 3. Jun 11th, 2011 - OSC 2011 Hokkaido
  4. 4. • : ( )• HN:• : Web• :• Twitter: @nipotan• Facebook: http://facebook.com/nipotan• Web: http://nipotan.com/• : Perl Jun 11th, 2011 - OSC 2011 Hokkaido
  5. 5. IPv6 Jun 11th, 2011 - OSC 2011 Hokkaido
  6. 6. IPv6• IPv6 1 • http://blog.livedoor.jp/nipotan/archives/51195204.html Jun 11th, 2011 - OSC 2011 Hokkaido
  7. 7. IPv6• IPv6 • NO• IPv6 • 2008 12 livedoor IPv6 EDGE Co.Lab v6 http://labs.edge.jp/colabv6/ • • IPv6 Jun 11th, 2011 - OSC 2011 Hokkaido
  8. 8. livedoor IPv6 • IPv6@2ch → http://ipv6.2ch.net/ •IPv6 • fixdap → http://fixdap.com/ • EDGE Co.Lab v6 • IPv6 IPv6 • IRCnet IRC • WIDE IRCnet Jun 11th, 2011 - OSC 2011 Hokkaido
  9. 9. IPv6 • • IPv6 • • • Jun 11th, 2011 - OSC 2011 Hokkaido
  10. 10. • APNIC 27 (Fab 2009 - Manila, Philippnes) • http://meetings.apnic.net/27/program/ipv6-in-3d • http://slidesha.re/nipotan-apnic27 Jun 11th, 2011 - OSC 2011 Hokkaido
  11. 11. IPv6 2 …•••• IPv6 Jun 11th, 2011 - OSC 2011 Hokkaido
  12. 12. APNIC IPv6•• IPv6• Jun 11th, 2011 - OSC 2011 Hokkaido
  13. 13. vs IPv6••• L7 • IP (Internet Protocol) → Jun 11th, 2011 - OSC 2011 Hokkaido
  14. 14. IPv6 … • IPv6 Ready! • IPv6 Ready! • IP OK • • • • • Jun 11th, 2011 - OSC 2011 Hokkaido
  15. 15. IPv4 Jun 11th, 2011 - OSC 2011 Hokkaido
  16. 16. 2011 4 15 IPv4 Jun 11th, 2011 - OSC 2011 Hokkaido
  17. 17. IPv4 • 32bit • 43 • 4,294,967,296 • • Jun 11th, 2011 - OSC 2011 Hokkaido
  18. 18. IPv4 IANA (Internet Assigned Numbers Authority) IR (Internet Registry) RIR (Regional Internet Registry) ARIN RIPE LACNIC AfriNIC APNIC (American Registry for Internet Numbers) NCC (Latin American and Caribbean Internet (African Network Information Centre) (Asia-Pacific Network Information Centre) (Réseaux IP Address Registry) Européens Network Coordination Centre) NIR (National Internet Registry) JPNIC (Japan Network KRNIC (Korea Network TWNIC (Taiwan Network etc... Information Center) Information Center) Information Center) LIR (Local Internet Registry) ISP IDC etc... End-users Jun 11th, 2011 - OSC 2011 Hokkaido
  19. 19. IPv4• 2011-01-31 IANA → RIR• 2011-04-15 APNIC → NIR• 2011-04-15 JPNIC • JPNIC APNIC → LIR Jun 11th, 2011 - OSC 2011 Hokkaido
  20. 20. • LIR• ISP • NAT (ISP Shared Address) ••• LIR •• IPv6 • Jun 11th, 2011 - OSC 2011 Hokkaido
  21. 21. LIR IPv4 • • • IPv6 • • • • • IPv6 Jun 11th, 2011 - OSC 2011 Hokkaido
  22. 22. IPv6•• IPv6 • • • IDC • •• IPv6 Jun 11th, 2011 - OSC 2011 Hokkaido
  23. 23. IPv6 IPv4 • • IPv4 • IPv6 • IPv4 (NAT) • • • / IPv6 Jun 11th, 2011 - OSC 2011 Hokkaido
  24. 24. IPv6 Jun 11th, 2011 - OSC 2011 Hokkaido
  25. 25. IPv6 • 128bit • 340 • 340,282,366,920,938,463,374,607,431,768,211,456 • IPv4 8 • • NAT Jun 11th, 2011 - OSC 2011 Hokkaido
  26. 26. IP • IPv4 • 32bit 8bit 10 • .( ) 11001011 00000000 01110001 00000001 203.0.113.1 Jun 11th, 2011 - OSC 2011 Hokkaido
  27. 27. IP • IPv6 • 128bit 16bit 16 • :( ) 0010000000000001 0000110110111000 0000101110101101 1111101011001110 0000000000000000 0000000000000000 0000000000000000 1101111010101101 2001:0db8:0bad:face:0000:0000:0000:dead 16 0 2001:db8:bad:face:0:0:0:dead 0 :: 2001:db8:bad:face::dead Jun 11th, 2011 - OSC 2011 Hokkaido
  28. 28. [ ] IP • IP • example.com • IPv4 • RFC 5735 - Special Use IPv4 Addresses •192.0.2.0/24 #TEST-NET-1 •198.51.100.0/24 # TEST-NET-2 •203.0.113.0/24 # TEST-NET-3 • IPv6 • RFC 3849 - IPv6 Address Prefix Reserved for Documentation • 2001:db8::/32 Jun 11th, 2011 - OSC 2011 Hokkaido
  29. 29. IPv6• IPv4 • 96bit 0 32bit IPv4 • IPv4 10 • ::203.0.113.1• IPv4 • 80bit 0 16bit 0xffff 32 bit IPv4 • ::ffff:203.0.113.1 Jun 11th, 2011 - OSC 2011 Hokkaido
  30. 30. IP • IPv4 URL IP http://203.0.113.1:8080/ IP Jun 11th, 2011 - OSC 2011 Hokkaido
  31. 31. IP • IPv6 URL IP http://2001:db8:bad:face::dead:8080/ RFC 3989 Uniform Resource Identifier (URI): Generic Syntaxhttp://[2001:db8:bad:face::dead]:8080/ IPv6 (IP-literal) [ ] Jun 11th, 2011 - OSC 2011 Hokkaido
  32. 32. IP • IPv6 URL • • RFC 5952 - A Recommendation for IPv6 Address Text Representation • 6. Notes on Combining IPv6 Addresses with Port Numbers Jun 11th, 2011 - OSC 2011 Hokkaido
  33. 33. Web IPv6 Jun 11th, 2011 - OSC 2011 Hokkaido
  34. 34. • PC IPv6User - IPv6 OK IDC - IPv6 OK Internet PC Jun 11th, 2011 - OSC 2011 Hokkaido
  35. 35. • IPv6 • Proxy IPv6User - IPv6 NG IDC - IPv6 OK Internet IPv4 IPv6 Proxy PC Jun 11th, 2011 - OSC 2011 Hokkaido
  36. 36. • HTTP Proxy IPv6 HTTP Proxy IPv6 Squid  Apache + mod_proxy  DeleGate  Jun 11th, 2011 - OSC 2011 Hokkaido
  37. 37. SSL ID ( ) • • • • 1 • IP • IPv4 / IPv6 • Jun 11th, 2011 - OSC 2011 Hokkaido
  38. 38. IPv6 DNS • IPv6 AAAA ( A) • DNS • EDNS0 • (512 Bytes) • IPv6 • IPv6 DNS Jun 11th, 2011 - OSC 2011 Hokkaido
  39. 39. IPv6 DNS • DNS IPv6 DNS Server AAAA IPv6 EDNS0 transport BIND    NSD    djbdns    * 3rd party patch Jun 11th, 2011 - OSC 2011 Hokkaido
  40. 40. MTA ( ) IPv6 • • SMTP IPv6 • • • MX AAAA % host -t MX example.com example.com mail is handled by 0 mail.example.com. % host -t AAAA mail.example.com mail.example.com has IPv6 address 2001:db8::c00:ffee Jun 11th, 2011 - OSC 2011 Hokkaido
  41. 41. MTA ( ) IPv6 • MTA IPv6 MTA IPv6 sendmail  postfix  qmail  * 3rd party patch Jun 11th, 2011 - OSC 2011 Hokkaido
  42. 42. • IPv6• ICMPv6 • ICMP (IPv4)• ping traceroute IPv6 • ping6 traceroute6 • Windows ping6 tracert6 % ping6 2001:db8:bad:face::dead % traceroute6 2001:db8:bad:face::dead Jun 11th, 2011 - OSC 2011 Hokkaido
  43. 43. • AAAA • ipv6.google.com • IPv6 % ping6 ipv6.google.com % traceroute6 ipv6.google.com % curl -Iv http://ipv6.google.com/ Jun 11th, 2011 - OSC 2011 Hokkaido
  44. 44. Web• IPv4 IPv6 • IP-base • • The KAME Project → http://www.kame.net/ • IPv6 • IPv6@2ch → http://ipv6.2ch.net/ •IPv6 Jun 11th, 2011 - OSC 2011 Hokkaido
  45. 45. Web• Apache • 1.3.x IPv6 • 2.0 IPv6 Apache Portable Runtime (APR) Listen [2001:db8::bad:face]:80 Listen 203.0.113.1:80 <VirtualHost [2001:db8::bad:face]:80> # IPv6 settings : : </VirtualHost> </VirtualHost 203.0.113.1:80> # IPv4 settings : : </VirtualHost> Jun 11th, 2011 - OSC 2011 Hokkaido
  46. 46. Web• lighttpd • IPv6 • OS Web Server IPv6 #server.use-ipv6 = "enable" server.port = 80 server.bind = "203.0.113.1" $SERVER["socket"] == "[2001:db8::bad:face]:80" { # IPv6 settings : } $SERVER["socket"] == "203.0.113.1:80" { # IPv4 settings : } Jun 11th, 2011 - OSC 2011 Hokkaido
  47. 47. Web• nginx • 0.7.36 IPv6 • … http { server { listen [2001:db8::bad:face]:80 server_name bad-face.example.com # IPv6 settings : } server { listen 127.0.0.1:80; listen 203.0.113.1:80; server_name bad-face.example.com; # IPv4 settings : } } Jun 11th, 2011 - OSC 2011 Hokkaido
  48. 48. IPv4/IPv6 • Web • Proxy Perl • IP $ENV{REMOTE_ADDR} PHP $_SERVER["REMOTE_ADDR"] Ruby ENV["REMOTE_ADDR"] Python os.environ.get("REMOTE_ADDR") Java request.getRemoteAddr() //javax.servlet.http.HttpServletRequest#getRemoteAddr() Jun 11th, 2011 - OSC 2011 Hokkaido
  49. 49. IPv4/IPv6 • IP • IPv6 ^(?:(?:(?:(?:[da-f]){1,4}:){6}|::(?:(?:[da-f]) {1,4}:){5}|(?:[da-f]){0,4}::(?:(?:[da-f]){1,4} :){4}|(?:(?:(?:[da-f]){1,4}:){0,1}(?:[da-f]){1 ,4})?::(?:(?:[da-f]){1,4}:){3}|(?:(?:(?:[da-f] ){1,4}:){0,2}(?:[da-f]){1,4})?::(?:(?:[da-f]){ 1,4}:){2}|(?:(?:(?:[da-f]){1,4}:){0,3}(?:[da-f ]){1,4})?::(?:(?:[da-f]){1,4}:)|(?:(?:(?:[da-f ]){1,4}:){0,4}(?:[da-f]){1,4})?::)(?:(?:[da-f] ){1,4}:(?:[da-f]){1,4}|(?:(?:d|[1-9]d|1dd|2 (?:[0-4]d|5[0-5])).){3}(?:(?:d|[1-9]d|1dd|2 (?:[0-4]d|5[0-5]))))|(?:(?:(?:[da-f]){1,4}:){0 ,5}(?:[da-f]){1,4})?::(?:[da-f]){1,4}|(?:(?:(? :[da-f]){1,4}:){0,6}(?:[da-f]){1,4})?::)$ • … • IPv6 Jun 11th, 2011 - OSC 2011 Hokkaido
  50. 50. IPv4/IPv6 • reverse proxy • IP proxy X-Forwarded-For • proxy • • • reverse proxy Jun 11th, 2011 - OSC 2011 Hokkaido
  51. 51. IPv4/IPv6 • reverse proxy (4 or 6) X-IP-Version • Perl $ENV{HTTP_X_IP_VERSION} PHP $_SERVER["HTTP_X_IP_VERSION"] Ruby ENV["HTTP_X_IP_VERSION"] Python os.environ.get("HTTP_X_IP_VERSION") Java request.getHeader("X-IP-Version") //javax.servlet.http.HttpServletRequest#getHeader() Jun 11th, 2011 - OSC 2011 Hokkaido
  52. 52. IPv4/IPv6 • Apache • RequestHeader Listen 80 <VirtualHost [2001:db8::bad:face]:80> ServerName bad-face.example.com RewriteEngine On : : RequestHeader set X-IP-Version 6 </VirtualHost> </VirtualHost 203.0.113.1:80> ServerName bad-face.example.com RewriteEngine On : : RequestHeader set X-IP-Version 4 </VirtualHost> Jun 11th, 2011 - OSC 2011 Hokkaido
  53. 53. IPv4/IPv6 • lighttpd • setenv.add-request-header $SERVER["socket"] == "[2001:db8::bad:face]:80" { : : setenv.add-request-header = ("X-IP-Version" => "6") } $SERVER["socket"] == "203.0.113.1:80" { : : setenv.add-request-header = ("X-IP-Version" => "4") } Jun 11th, 2011 - OSC 2011 Hokkaido
  54. 54. IPv4/IPv6 • nginx • proxy_set_header http { server { listen [2001:db8::bad:face]:80 server_name bad-face.example.com : : proxy_set_header X-IP-Version 6; } server { listen 127.0.0.1:80; listen 203.0.113.1:80; server_name bad-face.example.com; : : proxy_set_header X-IP-Version 4; } } Jun 11th, 2011 - OSC 2011 Hokkaido
  55. 55. IP• IP • DB • • IPv4 … 32bit → 4 • IPv6 … 128bit → 16 • • IPv4 15 • IPv6 Jun 11th, 2011 - OSC 2011 Hokkaido
  56. 56. IP• IPv6 • IPv4 0000:0000:0000:0000:0000:ffff:255.255.255.255 ----5----0----5----0----5----0----5----0----5• 45 • <netinet/in.h> • Socket #define INET_ADDRSTRLEN 16 #define INET6_ADDRSTRLEN 46 char ipv4_addr[INET_ADDRSTRLEN]; char ipv6_addr[INET6_ADDRSTRLEN]; Jun 11th, 2011 - OSC 2011 Hokkaido
  57. 57. • IPv6 • 2001:db8:bad:beef::0111:dead - - [11/Jun/2011:10:35:55 +0900] "GET / HTTP/1.1" 200 9972 "-" "Mozilla/5.0" 198.51.100.156 - - [11/Jun/2011:10:36:14 +0900] "GET / HTTP/ 1.1" 200 9972 "http://example.com/" "Mozilla/5.0" Jun 11th, 2011 - OSC 2011 Hokkaido
  58. 58. • IPv6 IPv6 Webalizer  AWStats  Analog  * 3rd party patch Jun 11th, 2011 - OSC 2011 Hokkaido
  59. 59. …• Web IPv6• Jun 11th, 2011 - OSC 2011 Hokkaido
  60. 60. Critical issues • APNIC 27 • Web … • IPv6 • IPv4 • IPv6 • IPv6 • IPv4 • Jun 11th, 2011 - OSC 2011 Hokkaido
  61. 61. Critical issues • Imagine • The all of interesting websites will be phased out in 2011 • • … Jun 11th, 2011 - OSC 2011 Hokkaido
  62. 62. • Web • • • …• IPv6 Jun 11th, 2011 - OSC 2011 Hokkaido
  63. 63. Jun 11th, 2011 - OSC 2011 Hokkaido

×