IPv4 & v6 address structures

Octets or segments, or a combination of both, make up Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6) addresses.
An IPv4 address has the following format: x . x . x . x where x is called an octet and must be a decimal value between 0 and 255. Octets are separated by periods. An IPv4 address must contain three periods and four octets. The following examples are valid IPv4 addresses:
  • 1 . 2 . 3 . 4
  • 01 . 102 . 103 . 104
The following example shows a screen that uses IPv4 addresses.
Ethernet IPv4 Panel 0175
Current Settings Frame 1:
IP Address (IPv4): 19.117.63.126
MAC Address: 18:36:F3:98:4F:9A
Gateway (IPv4): 19.117.63.253
Subnet Mask (IPv4): 255.255.253.0
[BACK] [ UP ] [DOWN] [ENTER]
Ethernet Mode: Manual IP Entry Press ENTER to Change Settings
An IPv6 address can have either of the following two formats:
  • Normal - Pure IPv6 format
  • Dual - IPv6 plus IPv4 formats
An IPv6 (Normal) address has the following format: y : y : y : y : y : y : y : y where y is called a segment and can be any hexadecimal value between 0 and FFFF. The segments are separated by colons - not periods. An IPv6 normal address must have eight segments, however a short form notation can be used in the Tape Library Specialist Web interface for segments that are zero, or those that have leading zeros. The short form notation can not be used from the operator panel.
The following list shows examples of valid IPv6 (Normal) addresses:
  • 2001 : db8: 3333 : 4444 : 5555 : 6666 : 7777 : 8888
  • 2001 : db8 : 3333 : 4444 : CCCC : DDDD : EEEE : FFFF
  • : : (implies all 8 segments are zero)
  • 2001: db8: : (implies that the last six segments are zero)
  • : : 1234 : 5678 (implies that the first six segments are zero)
  • 2001 : db8: : 1234 : 5678 (implies that the middle four segments are zero)
  • 2001:0db8:0001:0000:0000:0ab9:C0A8:0102 (This can be compressed to eliminate leading zeros, as follows: 2001:db8:1::ab9:C0A8:102 )
The following example shows a screen that uses IPv6 addresses:
Ethernet IPv6 Panel 0178
Current Settings Frame 1, Port B
Manual IP (IPv6): 684D:1111:222:3333:4444:5555:6:77
MAC Address: 18:36:F3:98:4F:9A DHCP IP (IPv6): Disabled
Press ENTER to Change Settings
Stateless Auto IP (IPv6): 0:0:0:0:0:0:0:0
[BACK] [ UP ] [DOWN] [ENTER]
An IPv6 (Dual) address combines an IPv6 and an IPv4 address and has the following format: y : y : y : y : y : y : x . x . x . x. The IPv6 portion of the address (indicated with y's) is always at the beginning, followed by the IPv4 portion (indicated with x's).
  • In the IPv6 portion of the address, y is called a segment and can be any hexadecimal value between 0 and FFFF. The segments are separated by colons - not periods. The IPv6 portion of the address must have six segments but there is a short form notation for segments that are zero.
  • In the IPv4 portion of the address x is called an octet and must be a decimal value between 0 and 255. The octets are separated by periods. The IPv4 portion of the address must contain three periods and four octets.
The following list shows examples of valid IPv6 (Dual) addresses:
  • 2001 : db8: 3333 : 4444 : 5555 : 6666 : 1 . 2 . 3 . 4
  • : : 11 . 22 . 33 . 44 (implies all six IPv6 segments are zero)
  • 2001 : db8: : 123 . 123 . 123 . 123 (implies that the last four IPv6 segments are zero)
  • : : 1234 : 5678 : 91 . 123 . 4 . 56 (implies that the first four IPv6 segments are zero)
  • : : 1234 : 5678 : 1 . 2 . 3 . 4 (implies that the first four IPv6 segments are zero)
  • 2001 : db8: : 1234 : 5678 : 5 . 6 . 7 . 8 (implies that the middle two IPv6 segments are zero)

IPv4 Address Example

An example ip-address:
69.89.31.226
The above ip-address is in the dotted decimal number format. An ip address is in the format of 4 sets of decimal numbers separated by dots. The decimal number in each and every set is in the range 0 to 255. Each and every set is called octet. So, there are 4 octets in an ip address.
However systems understands ip-address only in the binary format. So, when you configure your system with an ip-address in a dotted decimal number format, it is converted to a binary number format internally by the system as shown below.
01000101010110010001111111100010
(or)
01000101.01011001.00011111.11100010
IPv4 IP address are 32 bit numbers. In the above binary format, there are total of 32 binary numbers. Each and every binary number that are separated by the dot is converted to its corresponding binary number. There are total of 4 bytes here.
Each and every octet can have a value from 0 to 255. Since there are 4 octets in an ip-address, the total possible combination of unique ipv4 ip addresses are 4,294,967,296.

IPv6 Address Example

IPv4 stands for Internet Protocol Version 4. Most of the networks and systems in the internet is currently configured for IPv4. Since IPv4 ip address has only 32 bits (a total of 4,294,967,296 unique ip-addresses), the ip addresses in the internet are running out quickly. Please note that there is a big block of these ip addresses are reserved for special purposes (for example, private network and multicast addresses).
IPv6 stands for Internet Protocol Version 6. Since there is a possibility that we might run out of ip address in the internet, IPv6 was developed. IPv6 ip address has 128 bits. This is a huge improvement from the 32 bit ipv4 ip address. While lot of networks are getting configured for both IPv4 and IPv6, there is still a huge number of networks and systems in the internet that works only for IPv4. But eventually all these systems might go towards the IPv6 route.
IPv6 ip address is typically written in hexadecimal separated by colon. A colon separates 16 bit. The following is an example of IPv6 address:
2002:4559:1FE2::4559:1FE2
Leading zeros can be truncated. For example “0000” can be be just written as empty. In the above example :: indicates that it has multiple 0’s in that location. Typically the IPv6 format can be written down in three ways 1) compressed, 2) uncompressed and 3) fully uncompressed as shown below. All of the following are the same:
  • IPv6 Compressed (0000 is not displayed) – 2002:4559:1FE2::4559:1FE2
  • IPv6 Uncompressed (0000 is displayed as 0) – 2002:4559:1FE2:0:0:0:4559:1FE2
  • IPv6 Fully Uncompressed (0000 is fully displayed) – 2002:4559:1FE2:0000:0000:0000:4559:1FE2
Execute “ifconfig -a” which will display both ipv4 and ipv6 ip-addresss (if it is configured appropriately):
# ifconfig -a | egrep 'inet|inet6'
   inet addr:69.89.31.226
   inet6 addr: 2002:4559:1fe2::4559:1fe2

Comparison :-

DescriptionIPv4IPv6
Address32 bits long (4 bytes). Address is composed of a network and a host portion, which depend on address class. Various address classes are defined: A, B, C, D, or E depending on initial few bits. The total number of IPv4 addresses is 4 294 967 296.
The text form of the IPv4 address isnnn.nnn.nnn.nnn, where 0<=nnn<=255, and eachn is a decimal digit. Leading zeros can be omitted. Maximum number of print characters is 15, not counting a mask.
128 bits long (16 bytes). Basic architecture is 64 bits for the network number and 64 bits for the host number. Often, the host portion of an IPv6 address (or part of it) will be derived from a MAC address or other interface identifier.
Depending on the subnet prefix, IPv6 has a more complicated architecture than IPv4.
The number of IPv6 addresses is 1028 (79 228 162 514 264 337 593 543 950 336) times larger than the number of IPv4 addresses. The text form of the IPv6 address isxxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx, where eachx is a hexadecimal digit, representing 4 bits. Leading zeros can be omitted. The double colon (::) can be used once in the text form of an address, to designate any number of 0 bits. For example, ::ffff:10.120.78.40 is an IPv4-mapped IPv6 address. (See  RFC 3513  for details.
To view this RFC, see RFC Editor Link outside Information Center (www.rfc-editor.org/rfcsearch.html).
Address allocationOriginally, addresses were allocated by network class. As address space is depleted, smaller allocations using Classless Inter-Domain Routing (CIDR) are made. Allocation has not been balanced among institutions and nations.Allocation is in the earliest stages. The Internet Engineering Task Force (IETF) and Internet Architecture Board (IAB) have recommended that essentially every organization, home, or entity be allocated a /48 subnet prefix length. This would leave 16 bits for the organization to do subnetting. The address space is large enough to give every person in the world their own /48 subnet prefix length.
Address lifetimeGenerally, not an applicable concept, except for addresses assigned using DHCP.IPv6 addresses have two lifetimes: preferred and valid, with the preferred lifetime always <= valid.
 After the preferred lifetime expires, the address is not to be used as a source IP address for new connections if an equally good preferred address is available. After the valid lifetime expires, the address is not used (recognized) as a valid destination IP address for incoming packets or used as a source IP address. 
Some IPv6 addresses have, by definition, infinite preferred and valid lifetimes; for example link-local (see address scope).
Address maskUsed to designate network from host portion.Not used (see address prefix).
Address prefixSometimes used to designate network from host portion. Sometimes written as /nn suffix on presentation form of address.Used to designate the subnet prefix of an address. Written as/nnn (up to 3 decimal digits, 0 <= nnn <= 128) suffix after the print form. An example is fe80::982:2a5c/10, where the first 10 bits comprise the subnet prefix.
Address Resolution Protocol (ARP)Address Resolution Protocol is used by IPv4 to find a physical address, such as the MAC or link address, associated with an IPv4 address.IPv6 embeds these functions within IP itself as part of the algorithms for stateless autoconfiguration and neighbor discovery using Internet Control Message Protocol version 6 (ICMPv6). Hence, there is no such thing as ARP6.
Address scopeFor unicast addresses, the concept does not apply. There are designated private address ranges and loopback. Outside of that, addresses are assumed to be global.
 In IPv6, address scope is part of the architecture. Unicast addresses have two defined scopes, including link-local and global; and multicast addresses have 14 scopes. Default address selection for both source and destination takes scope into account. 
A scope zone is an instance of a scope in a particular network. As a consequence, IPv6 addresses sometimes must be entered or associated with a zone ID. The syntax is %zid wherezid is a number (usually small) or a name. The zone ID is written after the address and before the prefix. For example,2ba::1:2:14e:9a9b:c%3/48.
Address typesUnicast, multicast, and broadcast.Unicast, multicast, and anycast. See IPv6 address types for descriptions.
Communications trace
A tool to collect a detailed trace of TCP/IP (and other) packets that enter and leave the system.
 Same for IPv6, and IPv6 is supported. 
Configuration
You must configure a newly installed system before it can communicate with other systems; that is, IP addresses and routes must be assigned.
 Configuration is optional, depending on functions required. IPv6 can be used with any Ethernet adapter and can be run over the loopback interface. IPv6 interfaces are self-configuring using IPv6 stateless autoconfiguration. You can also manually configure the IPv6 interface. So, the system will be able to communicate with other IPv6 systems that are local and remote, depending on the type of network and whether an IPv6 router exists. 
Domain Name System (DNS)Applications accept host names and then use DNS to get an IP address, using socket APIgethostbyname().
Applications also accept IP addresses and then use DNS to get host names using gethostbyaddr().
For IPv4, the domain for reverse lookups is in-addr.arpa.
Same for IPv6. Support for IPv6 exists using AAAA (quad A) record type and reverse lookup (IP-to-name). An application may elect to accept IPv6 addresses from DNS (or not) and then use IPv6 to communicate (or not).
 The socket API gethostbyname() only supports IPv4. For IPv6, a new getaddrinfo() API is used to obtain (at application choice) IPv6 only, or IPv4 and IPv6 addresses. 
For IPv6, the domain used for reverse lookups is ip6.arpa, and if not found then ip6.int (see API getnameinfo()).
Dynamic Host Configuration Protocol (DHCP)
Used to dynamically obtain an IP address and other configuration information. i5/OS supports a DHCP server for IPv4.
The i5/OS implementation of DHCP does not support IPv6.
File Transfer Protocol (FTP)File Transfer Protocol allows you to send and receive files across networks.The i5/OS implementation of FTP does not support IPv6.
FragmentsWhen a packet is too big for the next link over which it is to travel, it can be fragmented by the sender (host or router).
 For IPv6, fragmentation can only occur at the source node, and reassembly is only done at the destination node. The fragmentation extension header is used. 
Host tableOn iSeries Navigator, a configurable table that associates an Internet address with a host name; for example, 127.0.0.1, loopback. This table is used by the sockets name resolver, either before a DNS lookup or after a DNS lookup fails (determined by host name search priority).Currently, this table does not support IPv6. Customers need to configure an AAAA record in a DNS for IPv6 domain resolution. You can run the DNS locally on the same system as the resolver, or you can run it on a different system.
InterfaceThe conceptual or logical entity used by TCP/IP to send and receive packets and always closely associated with an IPv4 address, if not named with an IPv4 address. Sometimes referred to as a logical interface.
Can be started and stopped independently of each other and independently of TCP/IP using STRTCPIFC and ENDTCPIFC commands and using iSeries Navigator.
Same concept as IPv4.
Can be started and stopped independently of each other and independently of TCP/IP using iSeries Navigator only.
Internet Control Message Protocol (ICMP)ICMP is used by IPv4 to communicate network information.Used similarly for IPv6; however, Internet Control Message Protocol version 6 (ICMPv6) provides some new attributes.
Basic error types remain, such as destination unreachable, echo request and reply. New types and codes are added to support neighbor discovery and related functions.
Internet Group Management Protocol (IGMP)IGMP is used by IPv4 routers to find hosts that want traffic for a particular multicast group, and used by IPv4 hosts to inform IPv4 routers of existing multicast group listeners (on the host).Replaced by MLD (multicast listener discovery) protocol for IPv6. Does essentially what IGMP does for IPv4, but uses ICMPv6 by adding a few MLD-specific ICMPv6 type values.
IP headerVariable length of 20-60 bytes, depending on IP options present.Fixed length of 40 bytes. There are no IP header options. Generally, the IPv6 header is simpler than the IPv4 header.
IP header optionsVarious options that might accompany an IP header (before any transport header).The IPv6 header has no options. Instead, IPv6 adds additional (optional) extension headers. The extension headers are AH and ESP (unchanged from IPv4), hop-by-hop, routing, fragment, and destination. Currently, IPv6 supports some extension headers.
IP header protocol byteThe protocol code of the transport layer or packet payload; for example, ICMP.The type of header immediately following the IPv6 header. Uses the same values as the IPv4 protocol field. But the architectural effect is to allow a currently defined range of next headers, and is easily extended. The next header will be a transport header, an extension header, or ICMPv6.
IP header Type of Service (TOS) byteUsed by QoS and differentiated services to designate a traffic class.Designates the IPv6 traffic class, similarly to IPv4. Uses different codes. Currently, IPv6 does not support TOS.
iSeries Navigator supportiSeries Navigator provides a complete configuration solution for TCP/IP.Same for IPv6. No CL commands are available for IPv6 configuration.
LAN connection
Used by an IP interface to get to the physical network. Many types exist; for example, token ring, and Ethernet. Sometimes referred to as the physical interface, link, or line.
 IPv6 can be used with any Ethernet adapters and is also supported over virtual Ethernet between logical partitions. 
Layer 2 Tunnel Protocol (L2TP)L2TP can be thought of as virtual PPP, and works over any supported line type.Currently, the i5/OS implementation of L2TP does not support IPv6.
Loopback addressAn interface with an address of 127.*.*.*(typically 127.0.0.1) that can only be used by a node to send packets to itself. The physical interface (line description) is named *LOOPBACK.The concept is the same as in IPv4. The single loopback address is 0000:0000:0000:0000:0000:0000:0000:0001 or::1 (shortened version). The virtual physical interface is named *LOOPBACK .
Maximum Transmission Unit (MTU)Maximum transmission unit of a link is the maximum number of bytes that a particular link type, such as Ethernet or modem, supports. For IPv4, 576 is the typical minimum.IPv6 has an architected lower bound on MTU of 1280 bytes. That is, IPv6 will not fragment packets below this limit. To send IPv6 over a link with less than 1280 MTU, the link-layer must transparently fragment and defragment the IPv6 packets.
NetstatA tool to look at the status of TCP/IP connections, interfaces, or routes. Available using iSeries Navigator and 5250.Same for IPv6, and IPv6 is supported for both 5250 and iSeries Navigator.
Network Address Translation (NAT)Basic firewall functions integrated into TCP/IP, configured using iSeries Navigator.Currently, NAT does not support IPv6. More generally, IPv6 does not require NAT. The expanded address space of IPv6 eliminates the address shortage problem and enables easier renumbering.
Network tableOn iSeries Navigator, a configurable table that associates a network name with an IP address without mask. For example, host Network14 and IP address 1.2.3.4.Currently, no changes are made to this table for IPv6.
Node info queryDoes not exist.A simple and convenient network tool that should work like ping, except with content: an IPv6 node may query another IPv6 node for the target's DNS name, IPv6 unicast address, or IPv4 address. Currently, not supported.
Packet filteringBasic firewall functions integrated into TCP/IP, configured using iSeries Navigator.
You cannot use packet filtering with IPv6.
Packet forwarding
The i5/OS TCP/IP stack can be configured to forward IP packets it receives for nonlocal IP addresses. Typically, the inbound interface and outbound interface are connected to different LANs.
IPv6 packets are not forwarded.
PINGBasic TCP/IP tool to test reachability. Available using iSeries Navigator and 5250.Same for IPv6, and IPv6 is supported, for both 5250 and iSeries Navigator.
Point-to-Point Protocol (PPP)PPP supports dialup interfaces over various modem and line types.
 Currently, the i5/OS implementation of PPP does not support IPv6. 
Port restrictions
These i5/OS panels allow a customer to configure a selected port number or port number ranges for TCP or UDP so that they are only available for a specific profile.
 Same for IPv6. Port restrictions for IPv6 are identical to those available in IPv4.  
PortsTCP and UDP have separate port spaces, each identified by port numbers in the range 1-65535.For IPv6, ports work the same as IPv4. Because these are in a new address family, there are now four separate port spaces. For example, there are two TCP port 80 spaces to which an application can bind, one in AF_INET and one in AF_INET6.
Private and public addressesAll IPv4 addresses are public, except for three address ranges that have been designated as private by IETF RFC 1918: 10.*.*.* (10/8),172.16.0.0 through 172.31.255.255 (172.16/12) , and 192.168.*.* (192.168/16). Private address domains are commonly used within organizations. Private addresses cannot be routed across the Internet.IPv6 has an analogous concept, but with important differences.
Addresses are public or temporary, previously termed anonymous. See RFC 3041. Unlike IPv4 private addresses, temporary addresses can be globally routed. The motivation is also different; IPv6 temporary addresses are meant to shield the identity of a client when it initiates communication (a privacy concern). Temporary addresses have a limited lifetime, and do not contain an interface identifier that is a link (MAC) address. They are generally indistinguishable from public addresses.
IPv6 has the notion of limited address scope using its architected scope designations (see address scope).
Protocol tableOn iSeries Navigator, a configurable table that associates a protocol name with its assigned protocol number; for example, UDP, 17. The system is shipped with a small number of entries: IP, TCP, UDP, ICMP.
 The table can be used with IPv6 without change. 
Quality of service (QoS)Quality of service allows you to request packet priority and bandwidth for TCP/IP applications.
 Currently, the i5/OS implementation of QoS does not support IPv6. 
RenumberingDone by manual reconfiguration, with the possible exception of DHCP. Generally, for a site or organization, a difficult and troublesome process to avoid if possible.Is an important architectural element of IPv6, and is largely automatic, especially within the /48 prefix.
RouteLogically, a mapping of a set of IP addresses (might contain only one) to a physical interface and a single next-hop IP address. IP packets whose destination address is defined as part of the set are forwarded to the next hop using the line. IPv4 routes are associated with an IPv4 interface, hence, an IPv4 address.
The default route is *DFTROUTE.
 Conceptually, similar to IPv4. One important difference: IPv6 routes are associated (bound) to a physical interface (a link, such as ETH03) rather than an interface. One reason that a route is associated with a physical interface is because source address selection functions differently for IPv6 than for IPv4. See Source address selection 
Routing Information Protocol (RIP)RIP is a routing protocol supported by the routed daemon.Currently, RIP does not support IPv6. IPv6 routing uses static routes.
Services table
On i5/OS, a configurable table that associates a service name with a port and protocol; for example, service name FTP-control, port 21, TCP, and User Datagram Protocol (UDP).
A large number of well-known services are listed in the services table. Many applications use this table to determine which port to use.
No changes are made to this table for IPv6.
Simple Network Management Protocol (SNMP)SNMP is a protocol for system management.
 Currently, the i5/OS implementation of SNMP does not support IPv6.  
Sockets APIThese APIs are the way applications use TCP/IP. Applications that do not need IPv6 are not affected by sockets changes to support IPv6.IPv6 enhances sockets so that applications can now use IPv6, using a new address family: AF_INET6.
The enhancements have been designed so that existing IPv4 applications are completely unaffected by IPv6 and API changes. Applications that want to support concurrent IPv4 and IPv6 traffic, or IPv6-only traffic, are easily accommodated using IPv4-mapped IPv6 addresses of the form::ffff:a.b.c.d, where a.b.c.d is the IPv4 address of the client.
The new APIs also include support for converting IPv6 addresses from text to binary and from binary to text.
See Using AF_INET6 address family for more information about sockets enhancements for IPv6.
Source address selectionAn application may designate a source IP (typically, using sockets bind()). If it binds to INADDR_ANY, a source IP is chosen based on the route.As with IPv4, an application can designate a source IPv6 address using bind(). Similarly to IPv4, it can let the system choose an IPv6 source address by using in6addr_any. But because IPv6 lines have many IPv6 addresses, the internal method of choosing a source IP is different.
Starting and stoppingUse STRTCP and ENDTCP to start or end TCP/IP.Same as IPv4. IPv4 and IPv6 are not started or stopped independently of one another or independently of TCP/IP. That is, you start and stop all of TCP/IP, not just IPv4 or IPv6.
 Any IPv6 interfaces are automatically started if the AUTOSTART parameter = *YES (the default). IPv6 cannot be used or configured without IPv4. The IPv6 loopback interface,::1, will automatically be defined and activated when IPv6 is started. 
TelnetTelnet allows you to log on and use a remote computer as though you were connected to it directly. Currently, the i5/OS implementation of Telnet does not support IPv6. 
Trace routeBasic TCP/IP tool to do path determination. Available using iSeries Navigator and 5250.Same for IPv6, and IPv6 is supported for both 5250 and iSeries Navigator.
Transport layers
 TCP, UDP, RAW.  
The same transports exist in IPv6.
Unspecified addressApparently, not defined, as such. Socket programming uses 0.0.0.0 as INADDR_ANY.Defined as ::/128 (128 0 bits). It is used as the source IP in some neighbor discovery packets, and various other contexts, like sockets. Socket programming uses ::/128 asin6addr_any.
Virtual private network (VPN)Virtual private network (using IPsec) allows you to extend a secure, private network over an existing public network.
 Currently, the i5/OS implementation of VPN does not support IPv6.