0% found this document useful (0 votes)
11 views87 pages

Module4a - IP Addressing

Module 4 covers the functionalities of the Network Layer, focusing on Internet Protocol (IP) and IPv4 addressing, including classful and classless addressing, subnetting, and Network Address Translation (NAT). It explains the structure of IP addresses, their unique identification, and the challenges of addressing in networking. Additionally, it discusses the allocation of address blocks and the importance of hierarchical addressing in facilitating communication across networks.

Uploaded by

Sakshi Biyani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views87 pages

Module4a - IP Addressing

Module 4 covers the functionalities of the Network Layer, focusing on Internet Protocol (IP) and IPv4 addressing, including classful and classless addressing, subnetting, and Network Address Translation (NAT). It explains the structure of IP addresses, their unique identification, and the challenges of addressing in networking. Additionally, it discusses the allocation of address blocks and the importance of hierarchical addressing in facilitating communication across networks.

Uploaded by

Sakshi Biyani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

MODULE 4

Network Layer
OUTLINE
• Functionalities of Network Layer

• Internet Protocol

• IPv4 Addressing (Logical, Global, Unique,

Hierarchical)
• Address Space, Notations

• Classful Addressing

• Subnetting

• Classless Addressing

• Network Address Translation (NAT)


Functions of Network Layer
• Source to Destination Delivery of Datagrams via

multiple networks. (Host To Host


Communication)
• Internet Protocol (IP)
• Connectionless protocol

• Relaying datagrams across network boundaries.


(Internetworking).
• Host Addressing to identify device
• Biggest Challenges
• Addressing: where should information be directed
to?
19.5

Levels of hierarchy in Telephone Numbering

Hierarchical addressing solves the problem of


devices communicating across networks of
networks
IP Addressing Structure
• Dotted decimal structure of a binary IP address
19.7

Note

An IPv4 address is 32 bits long.

Uniquely and universally defines the


connection of a device (for example, a
computer or a router) to the Internet.
19.8

Note

Unique – Each address defines one &


only one connection to Internet

* 2 devices can never have same address at same time *

* Address may be assigned to a device for a time period and


then taken away and assigned to another device *
19.9

Note

The address space of IPv4 is


232 or 4,294,967,296.
19.10

Figure 19.1 Dotted-decimal notation and binary notation for an IPv4 address
IP Addressing Structure
IP Addressing Structure
IP Addressing Structure
• Convert decimal to 8-bit binary
Example 19.1 19.14

Change the following IPv4 addresses from binary notation


to dotted-decimal notation.

Solution
We replace each group of 8 bits with its equivalent decimal
number and add dots for separation.
Example 19.2 19.15

Change the following IPv4 addresses from dotted-decimal


notation to binary notation.

Solution
We replace each decimal number with its binary equivalent
Example 19.3 19.16

Find the error, if any, in the following IPv4 addresses.

Solution
a. There must be no leading zero (045).
b. There can be no more than four numbers.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal
notation is not allowed.
19.17

Note

In classful addressing, the address


space is divided into five classes:
A, B, C, D, and E.
18.18
Figure 18.17: Hierarchy in addressing
19.19

Figure 19.2 Finding the classes in binary and dotted-decimal notation


19.20

Figure 19.2 Finding the classes in binary and dotted-decimal notation


21

IP Address Classes (Cont.)

• The 5 IP classes are split up based on the


value in the 1st octet:
22

Network/Host Portions
• The 32 bits of the IP address are divided into
Network & Host portions, with the octets
assigned as a part of one or the other.

Network & Host Representation


By IP Address Class
Class Octet1 Octet2 Octet3 Octet4

Class A Network Host Host Host

Class B Network Network Host Host

Class C Network Network Network Host


Example 19.4 19.23

Find the class of each address.


a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111

Solution
a. 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.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
19.24

Number of blocks and block size in classful IPv4 addressing


Specific Rules
• Each Network is assigned a network address
& every device or interface (such as a router
port) on the network is assigned a host
address.
• There are only 2 specific rules that govern the
value of the address.
• A host address cannot be designated by all
zeros or all ones.
• These are special addresses that are reserved
for special purposes.
26

Class A Addresses (Cont.)


• There are 16,777,214 Host addresses available
in a Class A address.
• To compute the number of hosts available in
any of the class addresses, where “n”
represents the number of bits in the host
portion:
(2n – 2) = Number of available hosts
• Class A address uses 7 bits to designate
network,
(27 – 2) = 126 or there can be 126 Class A
Networks. (Number of Class A networks)
27

Class A Addresses (Cont.)


• There are 128 Class A Network Addresses,

• but because addresses with all zeros aren’t used &


address 127 is a special purpose address,

• 126 Class A Networks are available.


28

Class B IP Addresses (Cont.)


• So how many Class B Networks can there be?
• Using our formula, (214 – 2), there can be 16,382 Class
B Networks & each Network can have (216 – 2) Hosts,
or 65,534 Hosts.
29

Special Addresses
• A few addresses are set aside for specific purposes.
• Network addresses that are all binary zeros, all binary
ones & Network addresses beginning with 127 are
special Network addresses.
30

Special Addresses (Cont.)


Classify and Define IPv4 Addresses
Figure 18.18: Occupation of the address space in classful 18.32
addressing
19.33

Note

In classful addressing, a large part of


the available addresses were wasted.

ernet Corporation for Assigned Names & Address (ICANN)


34

Classless Addressing
• Overcome Address Depletion
• No concept of classes
• Address granted in blocks retained
(variable length prefix)
• Depending on Requirement
• Classful is special case of Classless addressing
19.35

Note

Classful addressing, which is


almost obsolete, is replaced with
classless addressing.
19.36

Mask can help us to find the netid and the


hostid. (32 bit of contiguous 1 & 0’s)

Default masks for classful addressing

/n notation – Classless Addressing


(Classless InterDomain Routing)
19.37

Note

In IPv4 addressing, a block of


addresses can be defined as
x.y.z.t /n
in which x.y.z.t defines one of the
addresses and the /n defines the mask.
38

Subnetting
• Say Divide Large Block of Class A & B

• Several contiguous groups


• Assign Each group to smaller
networks
• Subnets
• Introduced in Classful addressing
• Increases the number of 1s in mask
• Ex : Class A network divided into 4
subnets. Prefix Length nsub = 10
39

Supernetting
• Time came when A & B depleted 
• Demand for mid-size blocks
• But not meet requirements
• Say 1000 address
• 4 Class C blocks to create one supernetwork

• Classless eliminated need to


supernetting
18.40
Figure 18.20: Slash notation (CIDR)
18.41
Figure 18.21: Information extraction in classless addressing

Set all
suffix bits
to 0s

Set all
suffix bits
to 1s
19.42

Note

The first address in the block can be


found by setting the rightmost
32 − n bits to 0s.
19.43

Note

The last address in the block can be


found by setting the rightmost
32 − n bits to 1s.
19.44

Note

The number of addresses in the block


can be found by using the formula
232−n.
Example 18.1

A classless address is given as 167.199.170.82/27. We can


find the above three pieces of information as follows. The
number of addresses in the network is 2 32− n = 25 = 32
addresses. The first address can be found by keeping the
first 27 bits and changing the rest of the bits to 0s.

The last address can be found by keeping the first 27 bits


and changing the rest of the bits to 1s.

18.45
Example 18.2

Alternate way to find the same for 167.199.170.82/27 using


the mask. The mask in dotted-decimal notation is
256.256.256.224 The AND, OR, and NOT operations can be
applied to individual bytes

18.46
47

Classless Address Blocks Allocation


1. The addresses in block must be contiguous, one
after another.

2. The number of requested addresses (N) in a block


must be a power of 2.
1. N=232-n (or)
2. n = 32 – log2N

3. The first address must be evenly divisible by the


number of addresses.
Example 19.6 19.48

A block of 16 addresses is granted to a small


organization. We know that one of the addresses is
205.16.37.39/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 00010000 00100101 0010000
or
205.16.37.32.
19.49

A block of 16 addresses granted to a small organization

Say one of the addresses is 205.16.37.39/28


Example 19.5 19.50

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 4), and the


first address is divisible by 16.

The first address, when converted to a decimal number, is


1,720,193,680 , which when divided by 16 results in
107,512,105
Example 19.7 19.51

Find the last address for the block

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 00101111
or
205.16.37.47
Example 19.8 19.52

Find the number of addresses

Solution
The value of n is 28, which means that number
of addresses is 2 32−28 or 16.
Example 19.9 19.53

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. the /28 can be represented as
11111111 11111111 11111111 11110000
(twenty-eight 1s and four 0s).

Find
a. The first address
b. The last address
c. The number of addresses.
Example 19.9 (continued) 19.54

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.
Example 19.9 (continued) 19.55

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 0s; the result is 1 otherwise. The
complement of a number is found by changing each 1
to 0 and each 0 to 1.
Example 19.9 (continued) 19.56

c. The number of addresses can be found by


complementing the mask, interpreting it as a decimal
number, and adding 1 to it.
19.57

Note

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.
19.58

Figure 19.4 A network configuration for the block 205.16.37.32/28


19.59
Subnetting
• Say Divide Large Block of Class A & B
• Several contiguous groups
• Assign Each group to smaller networks
• Subnets
• Introduced in Classful addressing
• Increases the number of 1s in mask
• Ex : Class A network divided into 4 subnets. Prefix Length n sub
= 10

61
Supernetting
• Time came when A & B depleted 
• Demand for mid-size blocks
• But not meet requirements
• Say 1000 address
• 4 Class C blocks to create one supernetwork
• Classless eliminated need to supernetting

62
Classless Addressing
• Overcome Address Depletion
• No concept of classes
• Address granted in blocks retained
(variable length prefix)
• Depending on Requirement
• Classful is special case of Classless addressing

63
Classless Address Blocks Allocation
1. The addresses in block must be contiguous, one
after another.

2. The number of requested addresses (N) in a block


must be a power of 2.
1. N=232-n (or)
2. n = 32 – log2N

3. The first address must be evenly divisible by the


number of addresses.
4. Largest block should be allotted first.

64
Subnetting – Example
• Organization Block 17.12.14.0/26
• 3 offices – to divide sub-blocks
• 1st office – 32 address
• 2nd office – 16 address
• 3rd office – 16 address
• Organization Block 17.12.14.0/26
• 64 address
• 3 offices – to divide sub-blocks
• 1st office – 32 address
• 2nd office – 16 address
• 3rd office – 16 address
• /n = 26, /n1 = 27 , /n2=28, /n3=28
19.67

Figure 19.8 Three-level hierarchy in an IPv4 address


19.68

Note

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.
19.69

Figure 19.7 Configuration and addresses in a subnetted network


19.70

Figure 19.8 Three-level hierarchy in an IPv4 address


19.71
Example 2

An ISP is granted a block of addresses starting with


190.100.0.0/16 (65,536 addresses). The ISP needs to
distribute these addresses to three groups of customers as
follows:
a. The first group has 64 customers; each needs 256
addresses.
b. The second group has 128 customers; each needs 128
addresses.
c. The third group has 128 customers; each needs 64
addresses.
Design the subblocks and find out how many addresses are
still available after these allocations.
19.72
Example 2 (continued)

Solution
Figure 19.9 shows the situation.
Group 1
For this group, each customer needs 256 addresses. This
means that 8 (log2 256) bits are needed to define each host.
The prefix length is then 32 − 8 = 24. The addresses are
19.73
Example 2 (continued)

Group 2
For this group, each customer needs 128 addresses. This
means that 7 (log2 128) bits are needed to define each host.
The prefix length is then 32 − 7 = 25. The addresses are
19.74
Example 2 (continued)

Group 3
For this group, each customer needs 64 addresses. This
means that 6 (log264) bits are needed to each host. The
prefix length is then 32 − 6 = 26. The addresses are

Number of granted addresses to the ISP: 65,536


Number of allocated addresses by the ISP: 40,960
Number of available addresses: 24,576
19.75

Figure 19.9 An example of address allocation and distribution by an ISP


19.76

IPv6 ADDRESSES

Despite all short-term solutions, address depletion is


still a long-term problem for the Internet. This and other
problems in the IP protocol itself have been the
motivation for IPv6.

Topics discussed in this section:


Structure
Address Space
19.77

Note

An IPv6 address is 128 bits long.


19.78

Figure 19.14 IPv6 address in binary and hexadecimal colon notation


19.79

Figure 19.15 Abbreviated IPv6 addresses


19.80
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 how many
0s we need to replace the double colon.

This means that the original address is.


19.81

Table 19.5 Type prefixes for IPv6 addresses


19.82

Table 19.5 Type prefixes for IPv6 addresses (continued)


19.83

Figure 19.16 Prefixes for provider-based unicast address


19.84

Figure 19.17 Multicast address in IPv6


19.85

Figure 19.18 Reserved addresses in IPv6


19.86

Figure 19.19 Local addresses in IPv6


Figure 19.19 Local addresses in IPv6

You might also like