0 ratings 0% found this document useful (0 votes) 3 views 21 pages Chapter 19 Notes
Chapter 19 discusses the network layer's logical addressing, specifically focusing on IPv4 addresses, which are 32-bit unique identifiers for devices on the Internet. It explains the structure of IPv4 addresses, including binary and dotted-decimal notations, and the concepts of classful and classless addressing schemes. The chapter highlights the limitations of classful addressing and the advantages of classless addressing in addressing depletion, allowing for more flexible allocation of IP address blocks.
AI-enhanced title and description
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Go to previous items Go to next items
Chapter 19- Network Layer: Logical Addressing1, INTRODUCTION
Communication at the network layer is host-to-host (computer-to-computer); a computer
somewhere in the world needs to communicate with another computer somewhere else in
the world. Usually, computers communicate through the Internet. The packet transmitted
by the sending computer may pass through several LANs or WANs before reaching the
destination computer. For this level of communication, we need a global addressing
scheme; we called this logical addressing or IP address.
2. IPv4 ADDRESSES
‘An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a
device (for example, a computer or a router) to the Internet.
‘+ IPv4 addresses are unique. They are unique in the sense that each address defines
one, and only one, connection to the Internet. Two devices on the Internet can never
have the same address at the same time. But by using some strategies, an address
may be assigned to a device for a time period and then taken away and assigned to
another device.
© On the other hand, if a device operating at the network layer has m connections to
the Internet, it needs to have m addresses. A router is such a device which needs as
many IP addresses as the number of ports are there in it,
2.1, Address Space
A protocol such as IPv4 that defines addresses has an address space.
‘+ An address space is the total number of addresses used by the protocol. If a
protocol uses N bits to define an address, the address space is 2" because each bit
can have two different values (0 or 1) and N bits can have 2" values.
© IPv4 uses 32-bit addresses, which means that the address space is 2° or
4,294,967,296 (more than 4 billion).
‘This means that, theoretically, if there were no restrictions, more than 4 billion devices
could be connected to the Internet. But the actual number is much less because of the
restrictions imposed on the addresses.
2.2. 1Pv4 Address Notations
‘There are two prevalent notations to show an IPv4 address:
a. Binary notation and
b. Dotted decimal notation.
‘a. Binary Notation
In binary notation, the IPv4 address is displayed as 32 bits. Each octet is often referred to as
a byte. So it is common to hear an IPv4 address referred to as a 32-bit address or a 4-byte
address. The following is an example of an IPv4 address in binary notation:
(01110101 10010101 00011101 00000010b. Dotted-Decimal Notation
To make the IPv4 address more compact and easier to read, Internet addresses are usually
written in decimal form with a decimal point (dot) separating the bytes. The following is the
dotted decimal notation of the above address:
117.149,29.2
Figure 19.1 shows an IPv4 address in both binary and dotted-decimal notation. Note that
because each byte (octet) is 8 bits, each number in dotted-decimal notation is a value
ranging from 0 to 255.
10000000 00001011 00000011 00011111
ee
[Link]
Figure 19.1 Dotted-decimal notation and binary notation for an IPv4 address
Example 19.1
Change the following IPv4 addresses from binary notation to dotted-decimal notation.
a, 10000001 00001011 00001011 11101111
b, 11000001 10000011 00011011 11111111
Solution
‘We replace each group of 8 bits with its equivalent decimal number (see Appendix B) and
add dots for separation.
a, [Link]
b, [Link],
Example 19.2
Change the following IPv4 addresses from dotted-decimal notation to binary notation.
a, [Link]
b. [Link]
Solution
We replace each decimal number with its binary equivalent,
a, 01101111 00111000 00101101 01001110
b, 11011101 00100010 00000111 01010010
2.3. Types of IPv4 Addressing Schemes
There are two types of IPva addressing schemes:
© Classful Addressing
© Classless Addressing2.3.1. Classful Addressing
IPv4 addressing, at its inception, used the concept of classes. This architecture is called
classful addressing, Although this scheme is becoming obsolete, we briefly discuss it here to
show the rationale behind classless addressing,
In classful addressing, the address space is divided into five classes: A, B, C, D, and E.
Each class occupies some part of the address space.
We can find the class of an address when given the address in binary notation or
dotted-decimal notation,
If the address is given in binary notation, the first few bits can immediately tell us the
class of the address.
If the address is given in decimal-dotted notation, the first byte defines the class.
Both methods are shown in Figure 19.2.
se ee es ee
cosa [ad loss A (EET)
class D [710 class 0 [224-239] [
Class € [7177 Class £ [240-255] [
Example 19.4
Find the class of each address.
‘a, 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
¢.[Link]
4. [Link]
Solution
1a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C address,
. The first byte is 14 (between 0 and 127); the class is A.
d. The first byte is 252 (between 240 and 255); the class is E.
[Link]. Classes and Blocks
One problem with classful addressing is that each class is divided into a fixed number of
blocks with each block having a fixed size as shown in Table 19.1.[Link].
Table 19.1 Number of blocks and block size in Classful IPv4 addressing
Class | Number of Blocks Block Size Application
A 28 2*=16,777,216 Unicast
B 16,384 Unicast
c 097,152 Unicast
D 1 68,435,456 Multicast
E 1 29=268,435,456 Reserved
Class A addresses were designed for large organizations with a large number of
attached hosts or routers.
Class B addresses were designed for midsize organizations with tens of thousands of
attached hosts or routers,
Class C addresses were designed for small organizations with a small number of
attached hosts or routers.
imitations of Classful Addressing
A block in class A address is too large for almost any organization. This means most
of the addresses in class A were wasted and were not used.
A block in class B is also very large, probably too large for many of the organizations
that received a class B block.
A block in elass € is probably too small for many organizations.
Class D addresses were designed for multicasting. Each address in this class is used
to define one group of hosts on the Internet. The Internet authorities wrongly
predicted a need for 268,435,456 groups. This never happened and many addresses
were wasted here too,
‘And lastly, the class & addresses were reserved for future use; only a few were used,
resulting in another waste of addresses.
[Link], Netid and Hostid
In classful addressing, an IP address in class A, B, or C is divided into netid and
hostic
These parts are of varying lengths, depending on the class of the address. Figure 19.2
shows some netid and hostid bytes.
The netid is in color, the hostid is in white. Note that the concept does not apply to
classes D and E,
In class A, one byte defines the netid and three bytes define the hostid.‘+ Inclass B, two bytes define the netid and two bytes define the hostid.
‘+ Inclass ¢, three bytes define the netid and one byte defines the hostid.
Table 19.2 Default masks for classful addressing
Class Binary Dotied-Decimal | CIDR
A TETTTTTT 00000000 00000000 00000000 [Link] 18
R TENNEY 11111111 00000000. 00000000 16
c TMM1111 11111111 11111111 00000000 pa
[Link]. Mask
‘A mask (also called the default mask) is a 32-bit number made of contiguous [if followed by
contiguous 8. The masks for classes A, B, and C are shown in Table 19.2. The concept does
not apply to classes D and E.
+ The mask can help us to find the netid and the hostid. For example, the mask for a
class A address has eight 1s, which means the first 8 bits of any address in class A
define the netid; the next 24 bits define the hostid.
The last column of Table 19.2 shows the mask in the form /n where n can be 8, 16, or
24 in classful addressing,
* This notation is also called slash notation or Classless Interdomain Routing (CIDR)
notation.
[Link]. Address Depletion Problem
‘The fast growth of the Internet led to the near depletion of the available addresses in
classful addressing scheme. Yet the number of devices on the Internet is much less than the
2” address space. We have run out of class A and B addresses, and a class C block is too
small for most midsize organizations.
* One solution that has alleviated the problem is the idea of classless addressing,
‘© Classful addressing, which is almost obsolete, is replaced with classless addressing.
2.3.2. Classless Addressing
To overcome address depletion and give more organizations access to the Internet, classless
addressing was designed and implemented. In this scheme, there are no classes, but the
addresses are still granted in blocks.
Address Blocks
* In classless addressing, when an entity, small or large, needs to be connected to the
Internet, it is granted a block (range) of addresses.
‘© The size of the block (the number of addresses) varies based on the nature and size
of the entity. For example, a household may be given only two addresses; a large
organization may be given thousands of addresses. An ISP, as the Internet serviceprovider, may be given thousands or hundreds of thousands based on the number of
customers it may serve.
* The Internet authorities impose three restrictions on classless address blocks:
1. The addresses in a block must be contiguous, one after another.
2. The number of addresses in a block must be a power of 2 (1, 2, 4,8, ..)
3. The first address must be evenly divisible by the number of addresses.
Example 19.5
Figure 19.3 shows a block of addresses, in both binary and dotted-decimal notation, granted
to a small business that needs 16 addresses. We can see that the restrictions are applied to
this block. The addresses are contiguous. The number of addresses is a power of 2 (16 = 2),
and the first address is divisible by 16. The first address, when converted to a decimal
number, is 3,440,387,360, which when divided by 16 results in 215,024,210.
Block Block
First [Link]
3
[Link] 3
3
3
2
2
Last [Link]
a. Decimal [Link]
Figure 19.3 A block of16 addresses granted to a small organization
[Link]. Mask
A better way to define a block of addresses is to select any address in the block and the
mask. As we discussed before, a mask is a 32-bit number in which the n leftmost bits are 1s
and the 32 - n rightmost bits are Os.
‘+ However, in classless addressing the mask for a block can take any value from 0 to
32. It is very convenient to give just the value of n preceded by a slash (CIDR
notation).
+ In 1Pv4 addressing, a block of addresses can be defined as x.y.z.t/n in which xy.2.t
defines one of the addresses and the /n defines the mask.
* The address and the /n notation completely define the whole block (the first
address, the last address, and the number of addresses)
First Address: The first address in the block can be found by setting the 32 n rightmost bits
in the binary notation of the address to Os.Example 19.6
A block of addresses is granted to a small organization. We know that one of the addresses
is [Link]/28. What is the first address in the block?
Solution
‘The binary representation of the given address is 11001101 00010000 00100101 00100111.
If we set 32 - 28 rightmost bits to 0, we get 11001101 0001000 00100101 0010000 or
[Link]. This is actually the block shown in Figure 19.3.
Last Address: The last address in the block can be found by setting the 32 -n rightmost bits
in the binary notation of the address to 1s
Example 19.7
Find the last address for the block in Example 19.6.
Solution
‘The binary representation of the given address is 11001101 00010000 00100101 00100111.
If we set 32 - 28 rightmost bits to 1, we get 11001101 00010000 00100101 0010 1111 or
[Link]. This is actually the block shown in Figure 19.3.
Block Block
First [Link]
[Link]
16 Addresses
Last —>| 205.1637.47
a. Decimal b. Binary
Figure 19.3 A block of16 addresses granted to a small organization
Example 19.8
Find the number of addresses in Example 19.6,
Solution
The value of nis 28, which means that number of addresses is BRI or 16
Example 19.9
Another way to find the first address, the last address, and the number of addresses is to
represent the mask as a 32-bit binary (or 8-digit hexadecimal) number. This is particularly
Useful when we are writing a program to find these pieces of information. In Example 19.5
the /28 can be represented as 11111111 11111111 11111111 11110000 (twenty-eight 15
and four Os). Find
a, The first addressb. The last address
¢. The number of addresses
Solution
‘a. The first address can be found by ANDing the given addresses with the mask. ANDing
here is done bit by bit. The result of ANDing 2 bits is 1 if both bits are 1s; the result is 0
otherwise.
Address: 11001101 00010000 00100101 00100111
Mask: 411111111 11111111 11111111 11110000
First address: 11001101 00010000 00100101 00100000
b. The last address can be found by ORing the given addresses with the complement of the
‘mask. ORing here is done bit by bit. The result of ORing 2 bits is 0 if both bits are Os; the
result is 1 otherwise. The complement of a number is found by changing each 1 to 0 and
each Oto 1,
Address: 11001101 00010000 00100101 00100111
Mask complement: 00000000 00000000 00000000 00001111
Last address: 11001101 00010000 00100101 00101111
‘c. The number of addresses can be found by complementing the mask, interpreting it asa
decimal number, and adding 1 to it.
Mask complement: 000000000 00000000 00000000 00001111
Number of addresses: 15 + 1=16
[Link]. Network Addresses
[Link] important concept in IP addressing is the network address. When an organization is
given a block of addresses, the organization is free to allocate the addresses to the devices
that need to be connected to the Internet.
© The first address in the class, however, is normally (not always) treated as a special
address. The first address is called the network address and defines the organization
network,
© Itdefines the organization itself to the rest of the world. Usually the first address is
the one that is used by routers to direct the message sent to the organization from
the outside,
Figure 19.4 shows an organization that is granted a 16-address block. The organization
network is connected to the Internet via a router. The router has two addresses. One
belongs to the granted block; the other belongs to the network that is at the other side of
the router. We call the second address x,y.z.t/n because we do not know anything about the
network it is connected to at the other side. All messages destined for addresses in the
organization block ([Link] to [Link]) are sent, directly or indirectly, to xy.z.t/n.We say directly or indirectly because we do not know the structure of the network to which
the other side of the router is connected.
Restof
the Tntemet
network
Network address: [Link]/28
Block Block
Fist —>[ [Link]
tat >| 205163747
3 Decimal Binary
TeAddresses
Figure 19.4 A network configuration for the block [Link]/28
The first address in a block is normally not assigned to any device; it is used as the
network address that represents the organization to the rest of the world.
[Link]. Hierarchy
IP addresses, like other addresses or identifiers we encounter these days, have levels of
hierarchy.
Two-Level Hierarchy: No Subnetting
‘An IP address can define only two levels of hierarchy when not subnetted
© The n leftmost bits of the address xy.z.t/n define the network (organization
network).
© The 32 ~ nr rightmost bits define the particular host (computer or router) to the
network.
‘+ The two common terms are prefix and suffix.
‘© The part of the address that defines the network is called the prefix; the part that
defines the host is called the suffix. Figure 19.5 shows the hierarchical structure of an
IPv4 address.28 bits bits
H Network prefix i '
i Host address '
Figure 19.5 Two levels of hierarchy in an IPv4 address
‘© The prefix is common to all addresses in the network; the suffix changes from one
device to another.
Each address in the block can be considered as a two-level hierarchical structure: the
leftmost n bits (prefix) define the network; the rightmost 32 - n bits define the host.
Three-Levels of Hierarchy: Subnetting
‘An organization that is granted a large block of addresses may want to create clusters of
networks (called subnets) and divide the addresses between the different subnets. The rest
of the world still sees the organization as one entity; however, internally there are several
subnets. All messages are sent to the router address that connects the organization to the
rest of the Internet; the router routes the message to the appropriate subnets. The
organization, however, needs to create small sub blocks of addresses, each assigned to
specific subnets. The organization has its own mask; each subnet must also have its own.
nasaae
‘Subret 2
raansias
‘yan
Tothe mstof
Figure 19.6 Configuration and addresses in a subnetted networkExample, suppose an organization is given the block [Link]/26, which contains 64
addresses. The organization has three offices and needs to divide the addresses into three
sub blocks of 32, 16, and 16 addresses. We can find the new masks by using the following
arguments:
1. Suppose the mask for the first subnet is n1, then JRRHHB must be 32, which means that n1
7.
2. Suppose the mask for the second subnet is n2, then BRIE must be 16, which means that
n2 = 28.
3, Suppose the mask for the third subnet isn3, then RBH must be 16, which means that n3
8.
This means that we have the masks 27, 28, 28 with the organization mask being 26. Figure
19.6 shows one configuration for the above scenario,
Let us check to see if we can find the subnet addresses from one of the addresses in the
subnet.
‘a. In subnet 1, the address [Link]/27 can give us the subnet address if we use the
mask /27 because
Host: 00010001 00001100 00001110 00011101
Mask: /27
‘Subnet: 00010001 00001100 00001110 00000000 .... ([Link])
b. In subnet 2, the address [Link]/28 can give us the subnet address if we use the
mask /28 because
Host: 00010001 00001100 00001110 00101101
Mask: /28
‘Subnet: 00010001 00001100 00001110 00100000 .... ([Link])
«c. In subnet 3, the address [Link]/28 can give us the subnet address if we use the mask
1/28 because
Host: 00010001 00001100 00001110 00110010
Mask: /28
‘Subnet: 00010001 00001100 00001110 00110000 .... ([Link])
Note that applying the mask of the network, /26, to any of the addresses gives us the
network address [Link]/26. We can say that through subnetting, we have three levels
of hierarchy. Note that in our example, the subnet prefix length can differ for the subnets as
shown in Figure 19.7.Subnet 1
Network prefix '
Subnet profix
Host address
Subnets 2and 3
t Network prefix
t Subnet prefix t
t Host address
Figure 19.7 Three-level hierarchy in an IPv4 address
More Levels of Hierarchy
‘The structure of classless addressing does not restrict the number of hierarchical levels. An
organization can divide the granted block of addresses into sub blocks. Each sub block can in
‘turn be divided into smaller sub blocks. And so on. One example of this is seen in the ISPs.
‘+ Anational ISP can divide a granted large block into smaller blocks and assign each of
them toa regional ISP.
‘+ A regional ISP can divide the block received from the national ISP into smaller blocks
and assign each one to a local ISP.
© Alocal ISP can divide the block received from the regional ISP into smaller blocks and
assign each one to a different organization.
* Finally, an organization can divide the received block and make several subnets out
of it
[Link], Address Alloca
© The next issue in classless addressing is address allocation. How are the blocks
allocated? The ultimate responsibility of address allocation is given to a global
authority called the Internet Corporation for Assigned Names and Addresses (ICANN).
‘+ However, ICANN does not normally allocate addresses to individual organizations. It
assigns a large block of addresses to an ISP. Each ISP, in turn, divides its assigned
block into smaller sub blocks and grants the sub blocks to its customers.
‘© In other words, an ISP receives one large block to be distributed to its Internet users.
This is called address aggregation: many blocks of addresses are aggregated in one
block and granted to one ISP.Example 19.10
‘An ISP is granted a block of addresses starting with [Link]/16 (65,536 addresses). The
ISP needs to distribute these addresses to three groups of customers as follows:
1. The first group has 64 customers; each needs 256 addresses.
b. The second group has 128 customers; each needs 128 addresses.
«. The third group has 128 customers; each needs 64 addresses.
Design the sub blocks and find out how many addresses are still available after these
allocations.
Solution
Figure 19.8 shows the situation.
Ise
‘Customer 001: [Link]/24
Customer 064: [Link]/24
‘Customer 001: 199.100.640/25
Customer 128: [Link]/25
Toand from
the Internet
‘Customer 001: [Link]/26
‘Customer 128: [Link]/26
Figure 19.8 An example of address allocation and distribution by an ISP
1. Group 1
For this group, each customer needs 256 addresses. This means that 8 (log,256) bits are
needed to define each host. The prefix length is then 32 -8 =24, The addresses are
1190.100.0.255/24
[cacatner, —wos0068004—_ss0xm63285282. Group2
For this group, each customer needs 128 addresses. This means that 7 (log, 128) bits are
needed to define each host. The prefix length is then 32 - 7 =25. The addresses are:
[iscoomer ——oameseans | nanos
t
128th Customer: [Link]/25 [Link]/25
3. Group3
For this group, each customer needs 64 addresses. This means that 6 (log, 64) bits are
needed to each host. The prefix length is then 32 - 6 =26, The addresses are
[Link]/26 [Link]/26,
Ea 190,100.159.192/26 190,100.159255/26
2.3.3. Network Address Translation (NAT)
The number of home users and small businesses that want to use the Internet is ever
increasing. In the beginning, a user was connected to the Internet with a dial-up line, which
means that she was connected for a specific period of time. An ISP with a block of addresses
could dynamically assign an address to this user. An address was given to a user when it was
needed. But the situation is different today. Home users and small businesses can be
connected by an ADSL line or cable modem. In addition, many are not happy with one
address; many have created small networks with several hosts and need an IP address for
‘each host. With the shortage of addresses, this is a serious problem.
‘[Link] solution to this problem is called network address translation (NAT)
‘+ NAT enables a user to have a large set of addresses internally and one address, or a
small set of addresses, externally. The traffic inside can use the large set; the traffic
outside, the small set.+ To separate the addresses used inside the home or business and the ones used for
the Internet, the Internet authorities have reserved three sets of addresses as
private addresses, shown in Table 19.3.
Table 19.3 Addresses for private networks
Range Total
[Link] to 10.2 ca
[Link] to 172.312! 22
[Link] to [Link]: as
‘* Any organization can use an address out of this set without permission from the
Internet authorities. Everyone knows that these reserved addresses are for private
networks,
‘+ They are unique inside the organization, but they are not unique globally. No router
will forward a packet that has one of these addresses as the destination address.
‘© The site must have only one single connection to the global Internet through a
router that runs the NAT software.
Figure 19.9 shows a simple implementation of NAT. As Figure 19.9 shows, the private
network uses private addresses. The router that connects the network to the global address
Uses one private address and one global address. The private network is transparent to the
rest of the Internet; the rest of the Internet sees only the NAT router with the address
[Link].
Site using private addresses
Internet
2002458
Figure 19.9 A NAT implementation
Address Translation
* All the outgoing packets go through the NAT router, which replaces the source
address in the packet with the global NAT address.
All incoming packets also pass through the NAT router, which replaces the
destination address in the packet (the NAT router global address) with the
appropriate private address. Figure 19.10 shows an example of address translation.Source: 200.2458
—_
Destination: 200.2458
Figure 19.10 Addresses in a NAT
Translation Table
Translating the source addresses for outgoing packets is straightforward. But how does the
NAT router know the destination address for a packet coming from the Internet? There may
be tens or hundreds of private IP addresses, each belonging to one specific host. The
problem is solved if the NAT router has a translation table
Using One IP Address
Figure
shown
In its simplest form, a translation table has only two columns: the private’ address
and the external address (destination address of the packet).
When the router translates the source address of the outgoing packet, it also makes
note of the destination address-where the packet is going,
When the response comes back from the destination, the router uses the source
address of the packet (as the external address) to find the private address of the
packet.
19.11 shows the idea. Note that the addresses that are changed (translated) are
in color.
In this strategy, communication must always be initiated by the private network,
‘The NAT mechanism described requires that the private network start the
communication.
NAT is used mostly by ISPs which assign one single address to a customer. The
customer, however, may be a member of a private network that has many private
addresses. In this case, communication with the Internet is always initiated from the
customer site, using a client program such as HTTP, TELNET, or FTP to access the
corresponding server program. For example, when e-mail that originates from a
noncustomer site is received by the ISP e-mail server, the e-mail is stored in the
‘mailbox of the customer until retrieved
A private network cannot run a server program for clients outside of its network if it
is using NAT technology.Destination: 25.82.10
\
Source: 200.2458
pe
Translation table
Private Betemal
172.1831 | 2582.10 +
Destination: 200.2458
Source: 2582.10
Figure 19.11 NAT address translation
Using a Pool of IP Addresses Since the NAT router has only one global address, only one
private network host can access the same external host. To remove this restriction, the NAT
router uses a pool of global addresses. For example, instead of using only one global
address ([Link]), the NAT router can use four addresses ([Link], [Link],
[Link], and [Link]). In this case, four private network hosts can communicate
with the same external host at the same time because each pair of addresses defines a
connection. However, there are still some drawbacks. In this example, no more than four
connections can be made to the same destination. Also, no private-network host can access
‘two external server programs (e.g., HTTP and FTP) at the same time.
Using Both IP Addresses and Port Numbers
© To allow a many-to-many relationship between private-network hosts and external
server programs, we need more information in the translation table. For example,
suppose two hosts with addresses [Link] and [Link] inside a private
network need to access the HTTP server on external host [Link].
‘+ Ifthe translation table has five columns, instead of two, that include the source and
destination port numbers of the transport layer protocol, the ambiguity is
eliminated. Table 19.4 shows an example of such a table.Table 19.4 Five-column translation table
Privare | Private | Extemai | External | Transport
Address | Port | Address | Port Protocol
172.1831 | 1400 | 25832] 80 TOP
1721832 | 101 | 2583. 80 ToP
‘+ When the response from HTTP comes back, the combination of source address
([Link]) and destination port number (1400) defines the-private network host to
which the response should be directed. Note also that for this translation to work,
the temporary port numbers (1400 and 1401) must be unique.
NAT and ISP
‘© An ISP that serves dial-up customers can use NAT technology to conserve addresses.
For example, suppose an ISP is granted 1000 addresses, but has 100,000 customers.
Each of the customers is assigned a private network address.
* The ISP translates each of the 100,000 source addresses in outgoing packets to one
of the 1000 global addresses; it translates the global destination address in incoming
packets to the corresponding private address. Figure 19.12 shows this concept.
172.183.
1000
addresses
172241
Isp
Internet
17230,100
Figure 19.12 An ISP and NAT
19.2 IPv6 ADDRESSES
Despite all short-term solutions, such as classless addressing and NAT, address depletion is
still a long-term problem for the Internet. This and other problems in the IP protocol itself,
such as lack of accommodation for real-time audio and video transmission, and encryption
and authentication of data for some applications, have been the motivation for IPv6.
Structure
An IPv6 address consists of 16 bytes (octets); itis 128 bits long.Hexadecimal Colon Notation
To make addresses more readable, IPv6 specifies hexadecimal colon notation. In this
notation, 128 bits is divided into eight sections, each 2 bytes in length. Two bytes in
hexadecimal notation requires four hexadecimal digits. Therefore, the address consists of 32
hexadecimal digits, with every four digits separated by a colon, as shown in Figure 19.13.
128 bite = 16 bytes = 32 hex digits
q
(ie: [Ea [a [a [a]
Figure 19.13 IPv6 address in binary and hexadecimal colon notation
1111110111 101100
aaa
Abbreviation
Although the IP address, even in hexadecimal format, is very long, many of the digits are
zeros. In this case, we can abbreviate the address. The leading zeros of a section (four digits
between two colons) can be omitted. Only the leading zeros can be dropped, not the trailing
zeros (see Figure 19.14).
Original
Abbreviated
More abbreviated | FDEC JOFF 3.0 5 FFFO
Coop
Figure 19.14 Abbreviated IPv6 addresses
Using this form of abbreviation, 0074 can be written as 74, OOOF as F, and 0000 as 0. Note
that 3210 cannot be abbreviated. Further abbreviations are possible if there are consecutive
sections consisting of zeros only. We can remove the zeros altogether and replace them
with a double semicolon, Note that this type of abbreviation is allowed only once per
address. If there are two runs of zero sections, only one of them can be abbreviated.
Reexpansion of the abbreviated address is very simple: Align the unabbreviated portions
and insert zeros to get the original expanded address.
Example 19.11
Expand the address 0:15::1:12:1213 to its original.Solution
We first need to align the left side of the double colon to the left of the original pattern and
the right side of the double colon to the right of the original pattern to find now many fi we
need to replace the double colon.
XXX!
XNX:XANN:AAMKINAX:XURM:XKAASAKEN
0: 15: sds 12:1213
This means that the original address is
Reference:
1. B.A Forouzan: Data Communications and Networking, Fourth edition, TMH .