'2008/09/24'에 해당되는 글 1건

  1. 2008/09/24 장인정신 Windows에서의 Dual-Stack IP 프로그래밍에서의 IPV6_V6ONLY socket option
BRULinux에/U서는 예전부터 STRONGIPV6_V6ONLY/STRONG socket option을 제공해왔었고 이 속성의 기본값이 0으로 되어 있었기에 별로 신경쓰지 않고도 EMIPv4와 IPv6를 동시지원하는 프로그램/EM을 작성할수 있었다.BR간혹 xinetd 의 경우는 accept후에 IPv6로 강제하는 경우가 있기는 한데 성능상 얼마나 좋을지는 의문이 간다.BRBR그런데 이것을 Windows에서 사용하려면 몇가지 역사와 Microsoft의 의도를 파악해야 할것 같다.BRBR우선 MSDN online 에서 STRONGIPV6_V6ONLY/STRONG에 대한 언급을 잠깐 인용해보자.BRBR DIV class=title xmlns:msxsl=urn:schemas-microsoft-com:xsltFONT size=1 DIV style=PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: #ffdaed DIV class=title xmlns:msxsl=urn:schemas-microsoft-com:xsltFONT color=#000000 size=1Indicates if a socket created for the AF_INET6 address family is restricted to IPv6 communications only. Sockets created for the AF_INET6 address family may be used for both IPv6 and IPv4 communications. Some applications may want to restrict their use of a socket created for the AF_INET6 address family to IPv6 communications only. /FONT PFONT size=1FONT color=#000000USTRONGFONT color=#0000ffWhen this value is non-zero (the default on Windows),/FONT/STRONG/U a socket created for the AF_INET6 address family can be used to send and receive IPv6 packets only./FONT/FONT/P PFONT color=#000000 size=1When this value is zero, a socket created for the AF_INET6 address family can be used to send and receive packets to and from an IPv6 address or an IPv4 address. Note that the ability to interact with an IPv4 address requires the use of IPv4 mapped addresses./FONT/P PFONT size=1FONT color=#000000UThis socket option is supported on Windows Vista or later/U./FONT/FONT/P/DIV/DIV/FONT/DIVBR위에서 중요한 부분은 파란색으로 표시한 부분인데 기본값이 0이 아닌 값이라는 점이다. 즉, 0이 아니라는 이야기는 STRONGAF_INET6로 생성한 소켓은 IPv4를 처리할수 없도록 강제한다는 점이다/STRONG.BRBR나는 여기까지 보고서 별 문제 없다고 생각했다. 그냥 그것을 0으로 설정하면 되는줄로만 알았다.BRBR헉! 근데 왠걸! STRONGVisualStudio C++ 2003 에서는 IPV6_V6ONLY define이 아예 없다./STRONGBRBR그래서 다시 위의 MSDN online문서를 보니 밑줄친 부분에 명시된것처럼 STRONGIPV6_V6ONLY옵션은 Windows Vista 이상에서만 지원된다고/STRONG 한다.BRBR어떤이는 그냥 Windows Vista 쓰면 되지! 라고 하는이도 있을것이다.BR하지만 그건 돈이 많거나 암흑의 경로로 윈도우를 쓰는 경우에 해당하는 분들일것이다.BR틀린말은 아니다. 그냥 Windows Vista 나 Windows Server 2008 구입해서 사용하면 되기는 한다.BR하지만 U고객은 최소한의 비용으로 최대의 효과를 원하는게 당연하고 프로그래머도 불가능하다고 결론된것이 아니면 더 찾아봐야 하는게 도리라고 생각한다/U.BRBR더 찾아보자......BRBRBRBR DIV class=title xmlns:msxsl=urn:schemas-microsoft-com:xsltFONT size=1 DIV style=PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: #ffdaed DIV class=title xmlns:msxsl=urn:schemas-microsoft-com:xsltFONT color=#000000 size=1Dual-Stack Sockets/FONT/DIV!--Content type: HTML. Transform: psdk2mtps.xslt.-- DIV class=clsServerSDKContent P PFONT color=#0000ff size=1UIn order to support both IPv4 and IPv6 on Windows XP Service Pack 1 (SP1) and on Windows Server 2003, an application has to create two sockets, one socket for use with IPv4 and one socket for use with IPv6. These two sockets must be handled separately by the application./U/FONT/P PFONT color=#000000FONT size=1Windows Vista and later offer the ability to create a single IPv6 socket which can handle both IPv6 and IPv4 traffic. For example, a TCP listening socket for IPv6 is created, put into dual stack mode, and bound to port 5001. This dual-stack socket can accept connections from IPv6 TCP clients connecting to port 5001 and from IPv4 TCP clients connecting to port 5001. This feature allows for greatly simplified application design and reduces the resource overhead required of posting operations on two separate sockets./FONTBR/FONT/P/DIV/DIV/FONTBRBRBRMSDN online에서 위와 같은 구문을 쉽게 찾을수 있었다.BR간략히 요약한다면 STRONGIPv6를 지원하는것은 Windows XP Service Pack 1과 Windows Server 2003 부터라는 예기다/STRONG.BR하지만 STRONGFONT color=#0000ffWindows Vista이후에서만 하나의 단일 소켓으로 IPv4와 IPv6를 처리할수 있도록 하는 옵션인 IPV6_V6ONLY가 존재하며 그 이전의 운영체제 버젼에서는 IPv6를 지원한다고만 했지 단일 소켓에서 IPv4와 IPv6를 지원하는것은 아니라고/FONT/STRONG 한다.BRBR결국 STRONGWindowsXPSP1과 WindowsServer2003에서는 단일소켓으로 처리할수 없기 때문에 IPv4용과 IPv6용 소켓을 따로 생성하며 응용프로그램에서 잘 설계해서 구현하는 방법을 제시했다/STRONG.BR그리고 성능상 그것이 유리할수도 있다는 식의 억양이 느껴진다.BRBR말이 쉽지 단일소켓으로 이미 오래전에 구현되었던 것을 그렇게 구현하려면 골치좀 아플거란것은 겪어볼 사람이라면 스트레스 지수에서 나타난다. 어쩄건 불가능한것은 아니다.BRBRU고객들은 아직 Windows Server 2008, Windows Vista를 단순히 IPv6지원하려고 구매하기에는 설득되지 않는다/U.BRBR그리고 Ustrcpy함수도 그냥 쓰게 냅두지 strcpy_s 로 강제하는것도 맘에 안드는 Microsoft다운 처사/U다.BRBRSTRONG개발자로서 Microsoft의 개발 Framework이 은근히 짜증나는것은 나만 그럴까?/STRONGBRBRBRBRnbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; - Write by A href=mailto:minzkn@minzkn.comminzkn@minzkn.com/A -/DIV
크리에이티브 커먼즈 라이센스
Creative Commons License
2008/09/24 15:28 2008/09/24 15:28
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.minzkn.com/rss/response/291

댓글+트랙백 ATOM :: http://blog.minzkn.com/atom/response/291

트랙백 주소 :: http://blog.minzkn.com/trackback/291

트랙백 RSS :: http://blog.minzkn.com/rss/trackback/291

트랙백 ATOM :: http://blog.minzkn.com/atom/trackback/291

댓글을 달아 주세요

댓글 RSS 주소 : http://blog.minzkn.com/rss/comment/291
댓글 ATOM 주소 : http://blog.minzkn.com/atom/comment/291