際際滷

際際滷Share a Scribd company logo
TCP/IP Protocol Suite 1
Copyright 息 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 5
IPv4
Addresses
TCP/IP Protocol Suite 2
OBJECTIVES:
OBJECTIVES:
 To introduce the concept of an address space in general and the
address space of IPv4 in particular.
 To discuss the classful architecture and the blocks of addresses
available in each class.
 To discuss the idea of hierarchical addressing and how it has
been implemented in classful addressing.
 To explain subnetting and supernetting for classful architecture.
 To discuss classless addressing, that has been devised to solve the
problems in classful addressing.
 To discuss some special blocks and some special addresses in
each block.
 To discuss NAT technology and show how it can be used to
alleviate of address depletion.
TCP/IP Protocol Suite 3
Chapter
Chapter
Outline
Outline
5.1 Introduction
5.1 Introduction
5.2 Classful Addressing
5.2 Classful Addressing
5.3 Classless Addressing
5.3 Classless Addressing
5.4 Special Addresses
5.4 Special Addresses
5.5 NAT
5.5 NAT
TCP/IP Protocol Suite 4
5-1 INTRODUCTION
The identifier used in the IP layer of the TCP/IP
protocol suite to identify each device connected to
the Internet is called the Internet address or IP
address. An IPv4 address is a 32-bit address that
uniquely and universally defines the connection of a
host or a router to the Internet; an IP address is the
address of the interface.
TCP/IP Protocol Suite 5
Topics Discussed in the Section
Topics Discussed in the Section
Notation
Range of Addresses
Operations
TCP/IP Protocol Suite 6
An IPv4 address is 32 bits long.
Note
The IPv4 addresses are unique
and universal.
Note
TCP/IP Protocol Suite 7
The address space of IPv4 is
232
or 4,294,967,296.
Note
Numbers in base 2, 16, and 256 are
discussed in Appendix B.
Note
TCP/IP Protocol Suite 8
Figure 5.1 Dotted-decimal notation
TCP/IP Protocol Suite 9
Change the following IPv4 addresses from binary notation to
dotted-decimal notation.
a. 10000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 11100111 11011011 10001011 01101111
d. 11111001 10011011 11111011 00001111
Solution
We replace each group of 8 bits with its equivalent decimal
number (see Appendix B) and add dots for separation:
a. 129.11.11.239
b. 193.131.27.255
c. 231.219.139.111
d. 249.155.251.15
Example
Example 5.1
TCP/IP Protocol Suite 10
Change the following IPv4 addresses from dotted-decimal
notation to binary notation.
a. 111.56.45.78
b. 221.34.7.82
c. 241.8.56.12
d. 75.45.34.78
Solution
We replace each decimal number with its binary equivalent:
a. 01101111 00111000 00101101 01001110
b. 11011101 00100010 00000111 01010010
c. 11110001 00001000 00111000 00001100
d. 01001011 00101101 00100010 01001110
Example
Example 5.2
TCP/IP Protocol Suite 11
Find the error, if any, in the following IPv4 addresses:
a. 111.56.045.78
b. 221.34.7.8.20
c. 75.45.301.14
d. 11100010.23.14.67
Solution
a. There should be no leading zeroes (045).
b. We may not have more than 4 bytes in an IPv4 address.
c. Each byte should be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal notation.
Example
Example 5.3
TCP/IP Protocol Suite 12
Change the following IPv4 addresses from binary notation to
hexadecimal notation.
a. 10000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
Solution
We replace each group of 4 bits with its hexadecimal
equivalent. Note that 0X (or 0x) is added at the beginning or the
subscript 16 at the end.
a. 0X810B0BEF or 810B0BEF16
b. 0XC1831BFF or C1831BFF16
Example
Example 5.4
TCP/IP Protocol Suite 13
Find the number of addresses in a range if the first address is
146.102.29.0 and the last address is 146.102.32.255.
Solution
We can subtract the first address from the last address in base
256 (see Appendix B). The result is 0.0.3.255 in this base. To
find the number of addresses in the range (in decimal), we
convert this number to base 10 and add 1 to the result..
Example
Example 5.5
TCP/IP Protocol Suite 14
The first address in a range of addresses is 14.11.45.96. If the
number of addresses in the range is 32, what is the last
address?
Solution
We convert the number of addresses minus 1 to base 256,
which is 0.0.0.31. We then add it to the first address to get the
last address. Addition is in base 256.
Example
Example 5.6
TCP/IP Protocol Suite 15
Figure 5.2 Bitwise NOT operation
TCP/IP Protocol Suite 16
Example
Example 5.7
TCP/IP Protocol Suite 17
Figure 5.3 Bitwise AND operation
TCP/IP Protocol Suite 18
Example
Example 5.8
TCP/IP Protocol Suite 19
Figure 5.4 Bitwise OR operation
TCP/IP Protocol Suite 20
Example
Example 5.9
TCP/IP Protocol Suite 21
5-2 CLASSFUL ADDRESSING
IP addresses, when started a few decades ago,
used the concept of classes. This architecture is
called classful addressing. In the mid-1990s, a new
architecture, called classless addressing, was
introduced that supersedes the original architecture.
In this section, we introduce classful addressing
because it paves the way for understanding
classless addressing and justifies the rationale for
moving to the new architecture. Classless
addressing is discussed in the next section.
TCP/IP Protocol Suite 22
Topics Discussed in the Section
Topics Discussed in the Section
Classes
Classes and Blocks
Two-Level Addressing
 Three-Level Addressing: Subnetting
 Supernetting
In classful addressing,
In classful addressing,
the address space is
the address space is
divided into five classes:
divided into five classes:
A
A,
, B
B,
, C
C,
, D
D, and
, and E
E.
.
TCP/IP Protocol Suite 24
Figure 4.2 Occupation of the address space
TCP/IP Protocol Suite 25
Figure 5.5 Occupation of address space
TCP/IP Protocol Suite 26
Figure 4.3 Finding the class in binary notation
TCP/IP Protocol Suite 27
Figure 5.7 Finding the class of an address using continuous checking
1
Class: A
0
Start
1
0
Class: B
1
0
Class: C
1
0
Class: D Class: E
TCP/IP Protocol Suite 28
How can we prove that we have 2,147,483,648 addresses in
class A?
Example 5
Solution
In class A, only 1 bit defines the class. The remaining 31 bits
are available for the address. With 31 bits, we can have 231
or 2,147,483,648 addresses.
TCP/IP Protocol Suite 29
Find the class of each address:
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 10100111 11011011 10001011 01101111
d. 11110011 10011011 11111011 00001111
Solution
See the procedure in Figure 5.7.
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 bit is 1; the second bit is 0. This is a class B
address.
d. The first 4 bits are 1s. This is a class E address.
Example
Example 5.10
TCP/IP Protocol Suite 30
Figure 4.5 Finding the class in decimal notation
TCP/IP Protocol Suite 31
Find the class of each address:
a. 227.12.14.87
b. 193.14.56.22
c. 14.23.120.8
d. 252.5.15.111
e.134.11.78.56
Solution
a. The first byte is 227 (between 224 and 239); the class is D.
b. The first byte is 193 (between 192 and 223); the class is C.
c. 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.
e. The first byte is 134 (between 128 and 191); the class is B.
Example
Example 5.11
TCP/IP Protocol Suite 32
In Example 5 we showed that class A has 231
(2,147,483,648)
addresses. How can we prove this same fact using dotted-
decimal notation?
Example 8
Solution
The addresses in class A range from 0.0.0.0 to
127.255.255.255. We need to show that the difference between
these two numbers is 2,147,483,648. This is a good exercise
because it shows us how to define the range of addresses
between two addresses. We notice that we are dealing with base
256 numbers here. Each byte in the notation has a weight. The
weights are as follows (see Appendix B):
See Next 際際滷
TCP/IP Protocol Suite 33
2563
, 2562
, 2561
, 2560
Example 8 (continued)
Last address: 127  2563
+ 255  2562
+
255  2561
+ 255  2560
= 2,147,483,647
First address: = 0
Now to find the integer value of each number, we multiply
each byte by its weight:
If we subtract the first from the last and add 1 to the result
(remember we always add 1 to get the range), we get
2,147,483,648 or 231
.
TCP/IP Protocol Suite 34
Figure 5.8 Netid and hostid
Figure 4-7
Blocks in class A
TCP/IP Protocol Suite 36
Millions of class A addresses
are wasted.
Note
Figure 4-8
Blocks in class B
TCP/IP Protocol Suite 38
Many class B addresses are wasted.
Note
TCP/IP Protocol Suite 39
Figure 4.9 Blocks in class C
TCP/IP Protocol Suite 40
Not so many organizations are so small
to have a class C block.
Note
TCP/IP Protocol Suite 41
Figure 5.12 The single block in Class D
TCP/IP Protocol Suite 42
Class D addresses are made of one
block, used for multicasting.
Note
TCP/IP Protocol Suite 43
Figure 5.13 The single block in Class E
TCP/IP Protocol Suite 44
The only block of class E addresses was
reserved for future purposes.
Note
TCP/IP Protocol Suite 45
The range of addresses allocated to an
organization in classful addressing
was a block of addresses in
Class A, B, or C.
Note
TCP/IP Protocol Suite 46
Figure 5.14 Two-level addressing in classful addressing
TCP/IP Protocol Suite 47
Example
Example 5.12
TCP/IP Protocol Suite 48
Figure 5.15 Information extraction in classful addressing
netid
First address
000 ... 0
Network Addresses
Network Addresses
The network address is the first address.
The network address defines the network to
the rest of the Internet.
Given the network address, we can find the
class of the address, the block, and the range
of the addresses in the block
TCP/IP Protocol Suite 50
An address in a block is given as 73.22.17.25. Find the number
of addresses in the block, the first address, and the last
address.
Solution
Figure 5.16 shows a possible configuration of the network that
uses this block.
1. The number of addresses in this block is N = 232n
=
16,777,216.
2. To find the first address, we keep the leftmost 8 bits and set
the rightmost 24 bits all to 0s. The first address is
73.0.0.0/8, in which 8 is the value of n.
3. To find the last address, we keep the leftmost 8 bits and set
the rightmost 24 bits all to 1s. The last address is
73.255.255.255.
Example
Example 5.13
TCP/IP Protocol Suite 51
Figure 5.16 Solution to Example 5.13
TCP/IP Protocol Suite 52
An address in a block is given as 180.8.17.9. Find the number
of addresses in the block, the first address, and the last
address.
Solution
Figure 5.17 shows a possible configuration of the network that
uses this block.
1. The number of addresses in this block is N = 232n
=
65,536.
2. To find the first address, we keep the leftmost 16 bits and set
the rightmost 16 bits all to 0s. The first address is
18.8.0.0/16, in which 16 is the value of n.
3. To find the last address, we keep the leftmost 16 bits and set
the rightmost 16 bits all to 1s. The last address is
18.8.255.255.
Example
Example 5.14
TCP/IP Protocol Suite 53
Figure 5.17 Solution to Example 5.14
TCP/IP Protocol Suite 54
An address in a block is given as 200.11.8.45. Find the number
of addresses in the block, the first address, and the last
address.
Solution
Figure 5.17 shows a possible configuration of the network that
uses this block.
1. The number of addresses in this block is N = 232n
= 256.
2. To find the first address, we keep the leftmost 24 bits and set
the rightmost 8 bits all to 0s. The first address is
200.11.8.0/24, in which 24 is the value of n.
3. To find the last address, we keep the leftmost 24 bits and set
the rightmost 8 bits all to 1s. The last address is
200.11.8.255/24.
Example
Example 5.15
TCP/IP Protocol Suite 55
Figure 5.18 Solution to Example 5.15
TCP/IP Protocol Suite 56
Figure 5.19 Sample Internet
TCP/IP Protocol Suite 57
The network address is the identifier of
a network.
Note
TCP/IP Protocol Suite 58
Figure 5.20 Network addresses
Mask
Mask
A mask is a 32-bit binary number that gives
the first address in the block (the network
address) when bitwise ANDed with an
address in the block.
TCP/IP Protocol Suite 60
Figure 5.21 Network mask
TCP/IP Protocol Suite 61
Figure 5.22 Finding a network address using the default mask
TCP/IP Protocol Suite 62
A router receives a packet with the destination address
201.24.67.32. Show how the router finds the network address of
the packet.
Solution
Since the class of the address is B, we assume that the router
applies the default mask for class B, 255.255.0.0 to find the
network address.
Example
Example 5.16
Example 12
Example 12
Given the address 23.56.7.91 and the
default class A mask, find the beginning
address (network address).
Solution
Solution
The default mask is 255.0.0.0, which means
that only the first byte is preserved
and the other 3 bytes are set to 0s.
The network address is 23.0.0.0.
Example 13
Example 13
Given the address 132.6.17.85 and the
default class B mask, find the beginning
address (network address).
Solution
Solution
The default mask is 255.255.0.0, which means
that the first 2 bytes are preserved
and the other 2 bytes are set to 0s.
The network address is 132.6.0.0.
Example 14
Example 14
Given the address 201.180.56.5 and the
class C default mask, find the beginning
address (network address).
Solution
Solution
The default mask is 255.255.255.0,
which means that the first 3 bytes are
preserved and the last byte is set to 0.
The network address is 201.180.56.0.
We must not
We must not
apply the default mask
apply the default mask
of one class to
of one class to
an address belonging
an address belonging
to another class.
to another class.
OTHER
ISSUES
4.13
4.13
Figure 4-12
Multihomed devices
Figure 4-13
Network addresses
TCP/IP Protocol Suite 70
221.45.71.0/24
221.45.71.20/24 221.45.71.178/24
221.45.71.64/24 221.45.71.126/24
Network:
Figure 5.38 Example of a directed broadcast address
Packet
Destination IP address:
221.45.71.255
Specific
Prefix Suffix
All 1s
TCP/IP Protocol Suite 71
221.45.71.20/24 221.45.71.178/24
221.45.71.64/24 221.45.71.126/24
Network
Figure 5.36 Example of limited broadcast address
Destination IP address:
255.255.255.255
Packet
Router blocks
the packet
TCP/IP Protocol Suite 72
Figure 5.35 Example of this host on this address
Source: 0.0.0.0
Destination: 255.255.255.255
Packet
DHCP Server
Figure 4-17
Example of specific host on this network
Figure 4-18
Example of loopback address
Transport layer
Application layer
Network layer
Process 1 Process 2
Destination address:127.x.y.z
Packet

More Related Content

Similar to Chap-05 classfull addrjjjjjjjjessing.ppt (20)

PPT
17433_ip-addressing-subnetting-supernetting.ppt
kashifmajeedjanjua
PPT
Umutima.ppt
kigaliac
PPT
Chap 04 ip addresses classful
Noctorous Jamal
PPTX
Module 6 ip addresing
Charlette Tolentino
PPT
Ip addressing classless
Abhishek Kesharwani
PPT
Ip addressing classless
Abhishek Kesharwani
PPT
Chap 05 ip addresses classfless
Noctorous Jamal
PPTX
Network layer. IP Addressing Part 1.pptx
MujtabaVlogs
PPT
Chap 04
IGNOU
PPTX
IP Address.pptx
Noralyn Dumogho
PPT
Ch04
tejindershami
PPT
About ip address
gaurav koriya
PPT
Classless addressing
Iqra Abbas
PPTX
Lecture W4 CN IP Addressing P1.pptx
ssuserc1e786
PPT
The network layer is a part of the internet communication process that sends ...
kiruthikeducation
PDF
Networking Brush Up for Amazon AWS Administrators
Aniekan Akpaffiong
PPTX
6-LEC- 6.pptx Network Layer. Addressing Subnetting Mask (default and subnet) ...
ZahouAmel1
PPT
IPv4 Address, IPv6 Address and its types
SanthiS10
PPTX
introduction to IPV4 addressing from chapter 4 of ipv4 addressing
KemalHussen
17433_ip-addressing-subnetting-supernetting.ppt
kashifmajeedjanjua
Umutima.ppt
kigaliac
Chap 04 ip addresses classful
Noctorous Jamal
Module 6 ip addresing
Charlette Tolentino
Ip addressing classless
Abhishek Kesharwani
Ip addressing classless
Abhishek Kesharwani
Chap 05 ip addresses classfless
Noctorous Jamal
Network layer. IP Addressing Part 1.pptx
MujtabaVlogs
Chap 04
IGNOU
IP Address.pptx
Noralyn Dumogho
About ip address
gaurav koriya
Classless addressing
Iqra Abbas
Lecture W4 CN IP Addressing P1.pptx
ssuserc1e786
The network layer is a part of the internet communication process that sends ...
kiruthikeducation
Networking Brush Up for Amazon AWS Administrators
Aniekan Akpaffiong
6-LEC- 6.pptx Network Layer. Addressing Subnetting Mask (default and subnet) ...
ZahouAmel1
IPv4 Address, IPv6 Address and its types
SanthiS10
introduction to IPV4 addressing from chapter 4 of ipv4 addressing
KemalHussen

Recently uploaded (20)

PPTX
Data Analytics using sparkabcdefghi.pptx
KarkuzhaliS3
PPTX
Communication_Skills_Class10_Visual.pptx
namanrastogi70555
DOCX
Artigo - Playing to Win.planejamento docx
KellyXavier15
PPTX
MENU-DRIVEN PROGRAM ON ARUNACHAL PRADESH.pptx
manvi200807
PPTX
Indigo dyeing Presentation (2).pptx as dye
shreeroop1335
PDF
Data science AI/Ml basics to learn .pdf
deokhushi04
PDF
TCU EVALUATION FACULTY TCU Taguig City 1st Semester 2017-2018
MELJUN CORTES
PDF
Exploiting the Low Volatility Anomaly: A Low Beta Model Portfolio for Risk-Ad...
Bradley Norbom, CFA
PPTX
25 items quiz for practical research 1 in grade 11
leamaydayaganon81
DOCX
The Influence off Flexible Work Policies
sales480687
PPTX
@Reset-Password.pptx presentakh;kenvtion
MarkLariosa1
PDF
Predicting Titanic Survival Presentation
praxyfarhana
PPTX
Artificial intelligence Presentation1.pptx
SaritaMahajan5
PDF
Orchestrating Data Workloads With Airflow.pdf
ssuserae5511
PDF
NVIDIA Triton Inference Server, a game-changing platform for deploying AI mod...
Tamanna36
PPTX
727325165-Unit-1-Data-Analytics-PPT-1.pptx
revathi148366
PDF
Informatics Market Insights AI Workforce.pdf
karizaroxx
DOCX
COT Feb 19, 2025 DLLgvbbnnjjjjjj_Digestive System and its Functions_PISA_CBA....
kayemorales1105
PPTX
Model Evaluation & Visualisation part of a series of intro modules for data ...
brandonlee626749
PDF
SaleServicereport and SaleServicereport
2251330007
Data Analytics using sparkabcdefghi.pptx
KarkuzhaliS3
Communication_Skills_Class10_Visual.pptx
namanrastogi70555
Artigo - Playing to Win.planejamento docx
KellyXavier15
MENU-DRIVEN PROGRAM ON ARUNACHAL PRADESH.pptx
manvi200807
Indigo dyeing Presentation (2).pptx as dye
shreeroop1335
Data science AI/Ml basics to learn .pdf
deokhushi04
TCU EVALUATION FACULTY TCU Taguig City 1st Semester 2017-2018
MELJUN CORTES
Exploiting the Low Volatility Anomaly: A Low Beta Model Portfolio for Risk-Ad...
Bradley Norbom, CFA
25 items quiz for practical research 1 in grade 11
leamaydayaganon81
The Influence off Flexible Work Policies
sales480687
@Reset-Password.pptx presentakh;kenvtion
MarkLariosa1
Predicting Titanic Survival Presentation
praxyfarhana
Artificial intelligence Presentation1.pptx
SaritaMahajan5
Orchestrating Data Workloads With Airflow.pdf
ssuserae5511
NVIDIA Triton Inference Server, a game-changing platform for deploying AI mod...
Tamanna36
727325165-Unit-1-Data-Analytics-PPT-1.pptx
revathi148366
Informatics Market Insights AI Workforce.pdf
karizaroxx
COT Feb 19, 2025 DLLgvbbnnjjjjjj_Digestive System and its Functions_PISA_CBA....
kayemorales1105
Model Evaluation & Visualisation part of a series of intro modules for data ...
brandonlee626749
SaleServicereport and SaleServicereport
2251330007
Ad

Chap-05 classfull addrjjjjjjjjessing.ppt

  • 1. TCP/IP Protocol Suite 1 Copyright 息 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 5 IPv4 Addresses
  • 2. TCP/IP Protocol Suite 2 OBJECTIVES: OBJECTIVES: To introduce the concept of an address space in general and the address space of IPv4 in particular. To discuss the classful architecture and the blocks of addresses available in each class. To discuss the idea of hierarchical addressing and how it has been implemented in classful addressing. To explain subnetting and supernetting for classful architecture. To discuss classless addressing, that has been devised to solve the problems in classful addressing. To discuss some special blocks and some special addresses in each block. To discuss NAT technology and show how it can be used to alleviate of address depletion.
  • 3. TCP/IP Protocol Suite 3 Chapter Chapter Outline Outline 5.1 Introduction 5.1 Introduction 5.2 Classful Addressing 5.2 Classful Addressing 5.3 Classless Addressing 5.3 Classless Addressing 5.4 Special Addresses 5.4 Special Addresses 5.5 NAT 5.5 NAT
  • 4. TCP/IP Protocol Suite 4 5-1 INTRODUCTION The identifier used in the IP layer of the TCP/IP protocol suite to identify each device connected to the Internet is called the Internet address or IP address. An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a host or a router to the Internet; an IP address is the address of the interface.
  • 5. TCP/IP Protocol Suite 5 Topics Discussed in the Section Topics Discussed in the Section Notation Range of Addresses Operations
  • 6. TCP/IP Protocol Suite 6 An IPv4 address is 32 bits long. Note The IPv4 addresses are unique and universal. Note
  • 7. TCP/IP Protocol Suite 7 The address space of IPv4 is 232 or 4,294,967,296. Note Numbers in base 2, 16, and 256 are discussed in Appendix B. Note
  • 8. TCP/IP Protocol Suite 8 Figure 5.1 Dotted-decimal notation
  • 9. TCP/IP Protocol Suite 9 Change the following IPv4 addresses from binary notation to dotted-decimal notation. a. 10000001 00001011 00001011 11101111 b. 11000001 10000011 00011011 11111111 c. 11100111 11011011 10001011 01101111 d. 11111001 10011011 11111011 00001111 Solution We replace each group of 8 bits with its equivalent decimal number (see Appendix B) and add dots for separation: a. 129.11.11.239 b. 193.131.27.255 c. 231.219.139.111 d. 249.155.251.15 Example Example 5.1
  • 10. TCP/IP Protocol Suite 10 Change the following IPv4 addresses from dotted-decimal notation to binary notation. a. 111.56.45.78 b. 221.34.7.82 c. 241.8.56.12 d. 75.45.34.78 Solution We replace each decimal number with its binary equivalent: a. 01101111 00111000 00101101 01001110 b. 11011101 00100010 00000111 01010010 c. 11110001 00001000 00111000 00001100 d. 01001011 00101101 00100010 01001110 Example Example 5.2
  • 11. TCP/IP Protocol Suite 11 Find the error, if any, in the following IPv4 addresses: a. 111.56.045.78 b. 221.34.7.8.20 c. 75.45.301.14 d. 11100010.23.14.67 Solution a. There should be no leading zeroes (045). b. We may not have more than 4 bytes in an IPv4 address. c. Each byte should be less than or equal to 255. d. A mixture of binary notation and dotted-decimal notation. Example Example 5.3
  • 12. TCP/IP Protocol Suite 12 Change the following IPv4 addresses from binary notation to hexadecimal notation. a. 10000001 00001011 00001011 11101111 b. 11000001 10000011 00011011 11111111 Solution We replace each group of 4 bits with its hexadecimal equivalent. Note that 0X (or 0x) is added at the beginning or the subscript 16 at the end. a. 0X810B0BEF or 810B0BEF16 b. 0XC1831BFF or C1831BFF16 Example Example 5.4
  • 13. TCP/IP Protocol Suite 13 Find the number of addresses in a range if the first address is 146.102.29.0 and the last address is 146.102.32.255. Solution We can subtract the first address from the last address in base 256 (see Appendix B). The result is 0.0.3.255 in this base. To find the number of addresses in the range (in decimal), we convert this number to base 10 and add 1 to the result.. Example Example 5.5
  • 14. TCP/IP Protocol Suite 14 The first address in a range of addresses is 14.11.45.96. If the number of addresses in the range is 32, what is the last address? Solution We convert the number of addresses minus 1 to base 256, which is 0.0.0.31. We then add it to the first address to get the last address. Addition is in base 256. Example Example 5.6
  • 15. TCP/IP Protocol Suite 15 Figure 5.2 Bitwise NOT operation
  • 16. TCP/IP Protocol Suite 16 Example Example 5.7
  • 17. TCP/IP Protocol Suite 17 Figure 5.3 Bitwise AND operation
  • 18. TCP/IP Protocol Suite 18 Example Example 5.8
  • 19. TCP/IP Protocol Suite 19 Figure 5.4 Bitwise OR operation
  • 20. TCP/IP Protocol Suite 20 Example Example 5.9
  • 21. TCP/IP Protocol Suite 21 5-2 CLASSFUL ADDRESSING IP addresses, when started a few decades ago, used the concept of classes. This architecture is called classful addressing. In the mid-1990s, a new architecture, called classless addressing, was introduced that supersedes the original architecture. In this section, we introduce classful addressing because it paves the way for understanding classless addressing and justifies the rationale for moving to the new architecture. Classless addressing is discussed in the next section.
  • 22. TCP/IP Protocol Suite 22 Topics Discussed in the Section Topics Discussed in the Section Classes Classes and Blocks Two-Level Addressing Three-Level Addressing: Subnetting Supernetting
  • 23. In classful addressing, In classful addressing, the address space is the address space is divided into five classes: divided into five classes: A A, , B B, , C C, , D D, and , and E E. .
  • 24. TCP/IP Protocol Suite 24 Figure 4.2 Occupation of the address space
  • 25. TCP/IP Protocol Suite 25 Figure 5.5 Occupation of address space
  • 26. TCP/IP Protocol Suite 26 Figure 4.3 Finding the class in binary notation
  • 27. TCP/IP Protocol Suite 27 Figure 5.7 Finding the class of an address using continuous checking 1 Class: A 0 Start 1 0 Class: B 1 0 Class: C 1 0 Class: D Class: E
  • 28. TCP/IP Protocol Suite 28 How can we prove that we have 2,147,483,648 addresses in class A? Example 5 Solution In class A, only 1 bit defines the class. The remaining 31 bits are available for the address. With 31 bits, we can have 231 or 2,147,483,648 addresses.
  • 29. TCP/IP Protocol Suite 29 Find the class of each address: a. 00000001 00001011 00001011 11101111 b. 11000001 10000011 00011011 11111111 c. 10100111 11011011 10001011 01101111 d. 11110011 10011011 11111011 00001111 Solution See the procedure in Figure 5.7. 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 bit is 1; the second bit is 0. This is a class B address. d. The first 4 bits are 1s. This is a class E address. Example Example 5.10
  • 30. TCP/IP Protocol Suite 30 Figure 4.5 Finding the class in decimal notation
  • 31. TCP/IP Protocol Suite 31 Find the class of each address: a. 227.12.14.87 b. 193.14.56.22 c. 14.23.120.8 d. 252.5.15.111 e.134.11.78.56 Solution a. The first byte is 227 (between 224 and 239); the class is D. b. The first byte is 193 (between 192 and 223); the class is C. c. 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. e. The first byte is 134 (between 128 and 191); the class is B. Example Example 5.11
  • 32. TCP/IP Protocol Suite 32 In Example 5 we showed that class A has 231 (2,147,483,648) addresses. How can we prove this same fact using dotted- decimal notation? Example 8 Solution The addresses in class A range from 0.0.0.0 to 127.255.255.255. We need to show that the difference between these two numbers is 2,147,483,648. This is a good exercise because it shows us how to define the range of addresses between two addresses. We notice that we are dealing with base 256 numbers here. Each byte in the notation has a weight. The weights are as follows (see Appendix B): See Next 際際滷
  • 33. TCP/IP Protocol Suite 33 2563 , 2562 , 2561 , 2560 Example 8 (continued) Last address: 127 2563 + 255 2562 + 255 2561 + 255 2560 = 2,147,483,647 First address: = 0 Now to find the integer value of each number, we multiply each byte by its weight: If we subtract the first from the last and add 1 to the result (remember we always add 1 to get the range), we get 2,147,483,648 or 231 .
  • 34. TCP/IP Protocol Suite 34 Figure 5.8 Netid and hostid
  • 36. TCP/IP Protocol Suite 36 Millions of class A addresses are wasted. Note
  • 38. TCP/IP Protocol Suite 38 Many class B addresses are wasted. Note
  • 39. TCP/IP Protocol Suite 39 Figure 4.9 Blocks in class C
  • 40. TCP/IP Protocol Suite 40 Not so many organizations are so small to have a class C block. Note
  • 41. TCP/IP Protocol Suite 41 Figure 5.12 The single block in Class D
  • 42. TCP/IP Protocol Suite 42 Class D addresses are made of one block, used for multicasting. Note
  • 43. TCP/IP Protocol Suite 43 Figure 5.13 The single block in Class E
  • 44. TCP/IP Protocol Suite 44 The only block of class E addresses was reserved for future purposes. Note
  • 45. TCP/IP Protocol Suite 45 The range of addresses allocated to an organization in classful addressing was a block of addresses in Class A, B, or C. Note
  • 46. TCP/IP Protocol Suite 46 Figure 5.14 Two-level addressing in classful addressing
  • 47. TCP/IP Protocol Suite 47 Example Example 5.12
  • 48. TCP/IP Protocol Suite 48 Figure 5.15 Information extraction in classful addressing netid First address 000 ... 0
  • 49. Network Addresses Network Addresses The network address is the first address. The network address defines the network to the rest of the Internet. Given the network address, we can find the class of the address, the block, and the range of the addresses in the block
  • 50. TCP/IP Protocol Suite 50 An address in a block is given as 73.22.17.25. Find the number of addresses in the block, the first address, and the last address. Solution Figure 5.16 shows a possible configuration of the network that uses this block. 1. The number of addresses in this block is N = 232n = 16,777,216. 2. To find the first address, we keep the leftmost 8 bits and set the rightmost 24 bits all to 0s. The first address is 73.0.0.0/8, in which 8 is the value of n. 3. To find the last address, we keep the leftmost 8 bits and set the rightmost 24 bits all to 1s. The last address is 73.255.255.255. Example Example 5.13
  • 51. TCP/IP Protocol Suite 51 Figure 5.16 Solution to Example 5.13
  • 52. TCP/IP Protocol Suite 52 An address in a block is given as 180.8.17.9. Find the number of addresses in the block, the first address, and the last address. Solution Figure 5.17 shows a possible configuration of the network that uses this block. 1. The number of addresses in this block is N = 232n = 65,536. 2. To find the first address, we keep the leftmost 16 bits and set the rightmost 16 bits all to 0s. The first address is 18.8.0.0/16, in which 16 is the value of n. 3. To find the last address, we keep the leftmost 16 bits and set the rightmost 16 bits all to 1s. The last address is 18.8.255.255. Example Example 5.14
  • 53. TCP/IP Protocol Suite 53 Figure 5.17 Solution to Example 5.14
  • 54. TCP/IP Protocol Suite 54 An address in a block is given as 200.11.8.45. Find the number of addresses in the block, the first address, and the last address. Solution Figure 5.17 shows a possible configuration of the network that uses this block. 1. The number of addresses in this block is N = 232n = 256. 2. To find the first address, we keep the leftmost 24 bits and set the rightmost 8 bits all to 0s. The first address is 200.11.8.0/24, in which 24 is the value of n. 3. To find the last address, we keep the leftmost 24 bits and set the rightmost 8 bits all to 1s. The last address is 200.11.8.255/24. Example Example 5.15
  • 55. TCP/IP Protocol Suite 55 Figure 5.18 Solution to Example 5.15
  • 56. TCP/IP Protocol Suite 56 Figure 5.19 Sample Internet
  • 57. TCP/IP Protocol Suite 57 The network address is the identifier of a network. Note
  • 58. TCP/IP Protocol Suite 58 Figure 5.20 Network addresses
  • 59. Mask Mask A mask is a 32-bit binary number that gives the first address in the block (the network address) when bitwise ANDed with an address in the block.
  • 60. TCP/IP Protocol Suite 60 Figure 5.21 Network mask
  • 61. TCP/IP Protocol Suite 61 Figure 5.22 Finding a network address using the default mask
  • 62. TCP/IP Protocol Suite 62 A router receives a packet with the destination address 201.24.67.32. Show how the router finds the network address of the packet. Solution Since the class of the address is B, we assume that the router applies the default mask for class B, 255.255.0.0 to find the network address. Example Example 5.16
  • 63. Example 12 Example 12 Given the address 23.56.7.91 and the default class A mask, find the beginning address (network address). Solution Solution The default mask is 255.0.0.0, which means that only the first byte is preserved and the other 3 bytes are set to 0s. The network address is 23.0.0.0.
  • 64. Example 13 Example 13 Given the address 132.6.17.85 and the default class B mask, find the beginning address (network address). Solution Solution The default mask is 255.255.0.0, which means that the first 2 bytes are preserved and the other 2 bytes are set to 0s. The network address is 132.6.0.0.
  • 65. Example 14 Example 14 Given the address 201.180.56.5 and the class C default mask, find the beginning address (network address). Solution Solution The default mask is 255.255.255.0, which means that the first 3 bytes are preserved and the last byte is set to 0. The network address is 201.180.56.0.
  • 66. We must not We must not apply the default mask apply the default mask of one class to of one class to an address belonging an address belonging to another class. to another class.
  • 70. TCP/IP Protocol Suite 70 221.45.71.0/24 221.45.71.20/24 221.45.71.178/24 221.45.71.64/24 221.45.71.126/24 Network: Figure 5.38 Example of a directed broadcast address Packet Destination IP address: 221.45.71.255 Specific Prefix Suffix All 1s
  • 71. TCP/IP Protocol Suite 71 221.45.71.20/24 221.45.71.178/24 221.45.71.64/24 221.45.71.126/24 Network Figure 5.36 Example of limited broadcast address Destination IP address: 255.255.255.255 Packet Router blocks the packet
  • 72. TCP/IP Protocol Suite 72 Figure 5.35 Example of this host on this address Source: 0.0.0.0 Destination: 255.255.255.255 Packet DHCP Server
  • 73. Figure 4-17 Example of specific host on this network
  • 74. Figure 4-18 Example of loopback address Transport layer Application layer Network layer Process 1 Process 2 Destination address:127.x.y.z Packet

Editor's Notes

  • #27: Start0Class: A1Start0Class: AClass: C01
  • #70: Limited broadcast is the broadcast limited to a single LAN and which is to be received by all. It is sent to reserved Class E , IP address 255.255.255.255. The destination MAC address for such frames will be FF:FF:FF:FF:FF:FF.油 The router simply drop the Limited broadcast address and does not forward it. Directed Broadcast address is the local subnet broadcast address. If the subnet is 192.168.10.0 , the directed broadcast address will be 192.168.10.255 , which will be heard by all in the same subnet hosts. The router will receive such packet and process it. The油 destination mac address will still be FF:FF:FF:FF:FF:FF, as it is to be received by all hosts. DHCP packets are Limited broadcast packets and NBNS uses directed broadcast packets.