EETimes

Embedded Systems September 2000 Vol13_10

Issue link: http://dc.ee.ubm-us.com/i/71837

Contents of this Issue

Navigation

Page 97 of 229

FIGURE 1 60 50 ~ c: 40 ~ Ill g !l 30 .! .5 .... .. E 20 J: Ill 0 10 0 hosts identified by DNS in less than 12 months for much of the past 10 to 15 years. With the explosion of Internet devi ces, PCs, PDAs, and even cell phones, the Inte rne t is expected to run out of IPv4 address spaces sooner than later. In contrast, 1Pv6 has 128-bit addresses. One way to understand how many addresses 128 bits represen ts is to think of a book that describes every possible Internet node addre ·s with 100 node description per page. lf each page was 0.1mm thick and was printed doubl e-s ided, the book to describe all possible IPv4 addresses would be 2,000 meters thick. This may sound like a big book, but [ 1993 ~ 1998 1999 the book describing all possible IPv6 addresses would be 2x1016 light-years thick. To date, the farth es t sight seen by the Hubble telescope is less than 2x1013 light-years.2 You may J TABLE 1 First argument in socketO. Address family I net address structure Generic address structure IP address structure AF _I NET struct sockaddr_in struct sockaddr struct in_addr structures' arid constants AF_INET6 PF_INET6 AF_INET6 struct sockaddr_in6 struct sockaddr_storage struct in6_addr Loopback address INADDR_LOOPBACK in6addr_loopback Wildcard address INADDR_ANY for binding listeners and receivers Name to address gethostbyname() Address to name gethostbyaddr() Free data structures returned by getaddrinfoO Report errors String to address inet_addr() Address to string inet_ntoa() Socket option for IP _TIL TIL Get reserved port rresvport() Execute a rcrndO command on a remote host in6addr_any IN6ADDR_ANY _I NIT getaddrinfo() getnameinfo() freeaddrinfo() gai_strerror() inet_pton() inet_ntop() 1Pv6_UNICAST _HOPS rresvport_af() rcmd_af() families are used interchangeably In sockaddr family field Note: sockaddr_in6 is larger than sockad Only when used to allocate storage Constant can only be IN6ADDR_LOOPBACK_INIT used for structure initialization Constant can only be used for structure initialization getaddrinfo() is multithread safe Errors from getaddrinfo() and getnameinfo() Added family parameter Added family parameter Set TIL/hop limit Used by rcmd() Added family parameter ted decimal" notation. For example, 123.45.67.89. 1Pv6 addresses are instead represented by hexadecimal 16-bit quantities separated by colons, for example, FF02:0:0:0:0: 1:200£: 8C6C (with th e exception noted below). A double colon (: :) can be used as a type of shorthand for a string of zeroes. The FF02::1:200E:8C6C is, address th erefore, equivalent to the previous IPv6 address. The double colon can only be used once in an address. There is also the notion of an !Pv4- compatible address, th at has the 96 high- order bi ts set to zero. This can be rep- resented as 0:0:0:0:0:0:0:123.45.67.89 or ::123.45.67.89. Whenever there is a case where a colon would cause confusion, a li teral 1Pv6 address can be quoted using square brackets . For example, a URL may look like http:/ I [fec0::55:a00: 20ff:fe90:58f8] :80/ index.h tml. Simplified header IPv6 headers consist of eight equal length fields. This is in contrast to IPv4, which has variable length fi eld , some of which are optional. IPv6 han- dles options by placing them in sepa- 96 SEPTEMBER 2ooo Embedded Systems Programming -ecall that IPv4 uses a "dot-

Articles in this issue

Archives of this issue

view archives of EETimes - Embedded Systems September 2000 Vol13_10