Embedded Systems September 2000 Vol13_10

Issue link:

Contents of this Issue


Page 98 of 229

rate extension headers that follow the actual IP header. These changes make 1Pv6 packets more efficient to route since there are fewer fields to examine and process. Flows A "flow" is defined by RFC 1883 as a sequence of packets that require spe- cial handling by the intervening routers.s Flows may be used to control quality of service to support "real- time" applications like voice and video. Authentication and privacy Although securi ty was considered when IPv4 was designed, e-commerce has tres ed the need for built-in secu- rity. IPv6 uses two extension headers for securi ty: the authentication header de cribed in RFC 18264, and the encapsulating security payload described in RFC 18275. The authentication header pro- vides strong integri ty and strong auth ntication for packets. The encap- sulating securi ty payload provides con- fidentiality by encrypting the payload of the packets. Autoconfiguration IPv6 addresses are longer than 1Pv4 addresses, and much more awkward for people to work with. One of the goals of the IPv6 standards was to sim- plify the management of addresses. Toward that end, IPv6 offers auto- configuration, which gives 1Pv6 machines plug-and-play connectivity. Two types of autoconfiguration are available: stateless and stateful. With stateless autoconfiguration, hosts automatically compute their own IP address by combining the network prefix obtained by the local router with their own Ethernet MAC address. Stateless autoconfiguration is described in RFC 2462.6 Because some people view the use of a MAC addre as an invasion of pri- vacy, a new draft proposes a way for hosts to compute their own IP addres based on a random number.7 Using a } } LlmNG 1 ~sing sockaddr_in6 struct sockaddr_in6 struct hostent sin; *hp; (void) memset((void *) &sin, sizeof(sin), 0); sin.sin6_family = hp->h_addrtype; sin.sin6_flowinfo = 0; sin.sin6_port = htons(port); (void) memcpy((void *) &sin.sin6_addr, (void *) &hp->h_addr, hp->h_length); if (connect(sock, (struct sockaddr *) &sin, sizeof(sin)) == -1) { } U5nNG2 int myconnect(char *host, int port> { struct sockaddr_in dest; struct hostent *hp; int ret; int sock; hp = gethostbyname(host); if (hp == M.JLL II hp->h_addrtype ! = AF _!NET II hp->h_length != 4 { /* handle error *' } dest.sin_family = AF_INET; = htons(port>; bcopy(hp->h_addr, &dest.sin)_addr, 4); sock = socket(AF_INET, SOCI\.._STREAM, 0>; if &dest, si zeof } freeaddrinfo(res>; return( sock); } break; b) int myconnect(char *host, int port) { struct addrinfo *res; struct addrinfo *aip; int error; int sock; error = getaddrinfo(node, service, NULL, &res); if (error != 0) { I* handle error *' } for (aip = res; aip != NULL; aip = aip->ai_next) { sock= socket(aip->ai_family, aip->ai_socktype, aip->ai_protocol>; if ai_addr, aip->ai_addrlen) -- -1) close(sock>; continue; { Embedded Systems Programming SEPTEMBER 2ooo 97

Articles in this issue

Archives of this issue

view archives of EETimes - Embedded Systems September 2000 Vol13_10