شبكاات 4 عنونة تمارين
شبكاات 4 عنونة تمارين
شبكاات 4 عنونة تمارين
The point is
to understand.”
Albert Einstein
Data Communications
and Networking; 5th ed.;
Behrouz A. Forouzan;
McGraw-Hill; 2013
IP addressing and Subnetting
Learning outcome
Understand the necessity of IP Addressing. ﻓﮭم ﺿرورة ﻋﻧوﻧﺔ ال اي ﺑﻲ
Be familiar with IPv4 classes. ﺗﻌرف ﻋﻠﻰ ﻓﺋﺎتIPv4
Distinguish between public and private IP addresses and their
applications. اﻟﺗﻣﯾﯾز ﺑﯾن ﻋﻧﺎوﯾن اﻻي ﺑﻲ اﻟﻌﺎﻣﺔ واﻟﺧﺎﺻﺔ وﺗطﺑﯾﻘﺎﺗﮭﺎ
Be familiar with the types of addresses that are used by the IPv4 and IP
v6 protocols. ﺗﻌرف ﻋﻠﻰ أﻧواع اﻟﻌﻧﺎوﯾن اﻟﻣﺳﺗﺧدﻣﺔ ﺑواﺳطﺔ ﺑروﺗوﻛوﻻتIPv4 وIP v6.
Describe the IPv4 and IP v6 addressing format.
Make a comparison between IPv4 and IP v6 addressing schemes
capabilities.
Understand the necessity, the principles and the methods of
subnetting.
Be familiar with the concepts of Network Address Translation (NAT).
Understand how the address space is managed. ( ﻛن ﻋﻠﻰ دراﯾﺔ ﺑﻣﻔﺎھﯾم ﺗرﺟﻣﺔ ﻋﻧوان اﻟﺷﺑﻛﺔNAT)
٤ .٤ ﺍﻟﺴﻮﺭﻱوان
ﺍﻟﺘﻘﻮﻳﻢاﻟﻌﻧ
ﻭﻓﻖﺎلﻣﺟ٦٧٦٧
ﻛﺎﻧﻮﻧﻮرة
إدا٠٣ﻓﮭم ﻛﯾﻔﯾﺔ
IP Addressing
Every device that exchanges information using the TCP/IP
protocol suite needs a unique IP address. ﻌﻠوﻣﺎت ﺑﺎﺳﺗﺧدام ﻣﺟﻣوﻋﺔ ﺑروﺗوﻛوﻻتIP ﯾﺣﺗﺎج ﻛل ﺟﮭﺎز ﯾﺗﺑﺎدل اﻟﻣ
إﻟﻰ ﻋﻧوان ﻓرﯾد.tcp/ip
An IP header contains the IP addresses of a source node and
a destination node, respectively. ﺗﺣﺗوي ﺗروﯾﺳﺔ اﻻي ﺑﻲ ﻋﻠﻰ ﻋﻧوان اي ﺑﻲ اﻟﻣﺻدر واﻟﮭدف ﻋﻠﻰ اﻟﺗواﻟﻲ
There are two IP addressing schemes. (32-bit IPv4 and 128-
bit IPv6) ھﻧﺎك ﻧوﻋﺎن ﻣن أﻧظﻣﺔ ﻋﻧوﻧﺔIP. (32 ﺑتIPv4 ﺑت128 وIPv6)
IPv4 Addressing Scheme
Classful: ﺑت إﻟﻰ ﻓﺋﺎت ﻣﺣددة إﻟﻰ اﻟﺷﺑﻛﺎت واﻟﻣﺿﯾﻔﯾن32 ﯾﺷﯾر اﻟﺗﻘﺳﯾم اﻷﺻﻠﻲ ﻟﻌﻧوان.............
The original segmentation of the 32–bit address into
specific classes denoting networks and hosts.
The IP address space divided into five different address
classes, Class A, Class B, Class C, Class D, and Class E.
Each class fixes the boundary between the network-prefix
and the host-number at a different point within the 32-bit
address.
Example 1
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 (see
Appendix B) and add dots for separation.
Solution
We replace each decimal number with its binary equivalent (see Appendix
B).
Example 3
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.
ﺍﻟﺴﻮﺭﻱﯾط ﻣن اﻟﺗدوﯾن اﻟﺛﻧﺎﺋﻲ واﻟﺗرﻣﯾز اﻟﻌﺷري
١١ .٤
ح ﺑﺧﻠ ﻏﯾر ﻣﺳﻣو
ﻭﻓﻖ ﺍﻟﺘﻘﻮﻳﻢ٦٧٦٧ ﻛﺎﻧﻮﻧﻮ٠٣
2^0=1
Classful IP Address Formats 2^1=2
2^2=4
32 Bits
2^3=8
2^4=16
A 2^5=32
2^6=64
B 10 Networks Hosts 2^7=128
C
١٣ .٤ IP addressing
Dotted‐Decimal Notation
Divides the 32-bit Internet address into four 8-bit (byte) fields
Specifies the value of each field independently as a decimal
number ﯾﺣدد ﻗﯾﻣﺔ ﻛل ﺣﻘل ﺑﺷﻛل ﻣﺳﺗﻘل ﻛرﻗم ﻋﺷري
The fields separated by dots. اﻟﺣﻘول ﻣﻔﺻوﻟﺔ ﺑﺎﻟﻧﻘﺎط
Makes Internet addresses easier for human users to read and
write ﯾﺟﻌل ﻋﻧﺎوﯾن اﻹﻧﺗرﻧت أﺳﮭل ﻟﻠﻘراءة واﻟﻛﺗﺎﺑﺔ ﻟﻠﻣﺳﺗﺧدﻣﯾن
١٤ .٤ ﻭﻓﻖ ﺍﻟﺘﻘﻮﻳﻢ ﺍﻟﺴﻮﺭﻱ٦٧٦٧ ﻛﺎﻧﻮﻧﻮ٠٣
Example 4
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.
ClassfulI Pv4 addressing
In classful addressing, a large part of the available
addresses were wasted. ﺗم إھدار ﺟزء ﻛﺑﯾر ﻣن اﻟﻌﻧﺎوﯾن اﻟﻣﺗﺎﺣﺔ، ﻓﻲ اﻟﻌﻧوﻧﺔ اﻟﻣﺻﻧﻔﺔ
Classful addressing, which is almost obsolete, is replaced
with classless addressing.
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.
The first address in the block can be found by setting the
rightmost 32 − n bits to 0s.
١٧ .٤ ﻭﻓﻖ ﺍﻟﺘﻘﻮﻳﻢ ﺍﻟﺴﻮﺭﻱ٦٧٦٧ ﻛﺎﻧﻮﻧﻮ٠٣
IPv4 Addressing Scheme
Classless:
The full address range can be used without regard to
bit reservation for classes. ﯾﻣﻛن اﺳﺗﺧدام ﻧطﺎق اﻟﻌﻧوان اﻟﻛﺎﻣل دون اﻟﻧظر إﻟﻰ ﺣﺟز اﻟﺑت ﻟﻠﻔﺋﺎت.
is primarily not used in direct host assignment. ﻻ ﯾﺗم اﺳﺗﺧداﻣﮫ ﺑﺷﻛل أﺳﺎﺳﻲ ﻓﻲ ﺗﻌﯾﯾن
اﻟﻣﺿﯾف اﻟﻣﺑﺎﺷر
is directly applied to the routing tables of the
Internet and ISPs.
ﯾﺗم ﺗطﺑﯾﻘﮫ ﻣﺑﺎﺷرة ﻋﻠﻰ ﺟداول اﻟﺗوﺟﯾﮫ ﻟﻺﻧﺗرﻧت وﻣزودي ﺧدﻣﺎت اﻹﻧﺗرﻧت
ﯾﺗم ﺗطﺑﯾﻖ اﻟﻘﯾود 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 = 24). This block of IP addresses is represented by:
205.16.37.32/28
٢٠ .٤ ﻭﻓﻖ ﺍﻟﺘﻘﻮﻳﻢ ﺍﻟﺴﻮﺭﻱ٦٧٦٧ ﻛﺎﻧﻮﻧﻮ٠٣
Example
A /28 block of addresses is granted to a small organization. We
know that one of the addresses is 205.16.37.39. What is the first
address in the block? What is its x.y.z.t/n representation?
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 0
or
205.16.37.32
The block representation is 205.16.37.32/28
٢١ .٤ ﻭﻓﻖ ﺍﻟﺘﻘﻮﻳﻢ ﺍﻟﺴﻮﺭﻱ٦٧٦٧ ﻛﺎﻧﻮﻧﻮ٠٣
Example
Find the last address for the block in The previous Example .
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
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
٢٣ .٤ ﻭﻓﻖ ﺍﻟﺘﻘﻮﻳﻢ ﺍﻟﺴﻮﺭﻱ٦٧٦٧ ﻛﺎﻧﻮﻧﻮ٠٣
How many addresses in IPv6?
IPv6 Addresses:
2128=340,282,366,920,938,463,463,374,607,431,768,211,456
≈ 3.4 x 1038
Surface area of Earth: 510,072,000 km2
Size of Atom: 10-10 m = 0.1 nm = 1 Angstrom (Å)
“Area of Atom”: 1 square angstrom (Ų)= 10-20 m2
Number of atoms on Earth’s surface: 510,072,000 km2 / 10-20
m2 = 5.1 x 1031
Number of IPv6 addresses for each atom on the surface
of the Earth: ~ 6.7 million.
٢٤ .٤ ﻭﻓﻖ ﺍﻟﺘﻘﻮﻳﻢ ﺍﻟﺴﻮﺭﻱ٦٧٦٧ ﻛﺎﻧﻮﻧﻮ٠٣
IPv6 – Internet for everything!
IPv6 general address format
ُﺗﺳﺗﺧدم:ﺑﺎدﺋﺔ اﻟﺗوﺟﯾﮫ اﻟﻌﺎﻟﻣﯾﺔ
Global routing prefix: It is used to identify a special address, ﻣﺛل، ﻟﺗﺣدﯾد ﻋﻧوان ﺧﺎص
أو ﻧطﺎق، اﻹرﺳﺎل اﻟﻣﺗﻌدد
such as multicast, or an address range assigned to a site. ﻋﻧوان ﻣﻌﯾن ﻟﻣوﻗﻊ ﻣﺎ.
Subnet ID: This part is used to identify a link within a site. ﺎ ﯾطﺳدﺗاﺧﺧدلم:فزاﻟءﺷﻟﺑﺗﻛﻌﺔرﯾاﻟﻔفر اﻋرﯾﺗﺔﺑ ﻣﻌر
ھذا اﻟﺟ
The subnet ID may also be referred to as subnet prefix or ﺿﺎ اﻹﺷﺎرة إﻟﻰ ً وﯾﻣﻛن أﯾ، ﻣوﻗﻊ
ﻣﻌرف اﻟﺷﺑﻛﺔ اﻟﻔرﻋﯾﺔ ﺑﺑﺎدﺋﺔ
simply "subnet". A subnet ID is associated with one link. " اﻟﺷﺑﻛﺔ اﻟﻔرﻋﯾﺔ أو ﺑﺑﺳﺎطﺔ
ﯾرﺗﺑط ﻣﻌرف."اﻟﺷﺑﻛﺔ اﻟﻔرﻋﯾﺔ
Multiple subnet IDs may be assigned to one link. اﻟﺷﺑﻛﺔ اﻟﻔرﻋﯾﺔ ﺑﺎرﺗﺑﺎط واﺣد،
Interface ID: An interface ID is used to identify an interface ت وﯾﻣﻛن ﺗﻌﯾﯾن ﻣﻌرﻓﺎت ﺷﺑﻛﺎ
ﻓرﻋﯾﺔ ﻣﺗﻌددة ﻻرﺗﺑﺎط واﺣد
on a link and needs to be unique on that link.
ﺑﺎط٢٦ﻻرﺗ.٤ ﺍﻟﺴﻮﺭﻱرﺗﺑﺎط وﯾﺟب أن ﯾﻛون ﻓرﯾًدا ﻋﻠﻰ ھذا ا
ﺍﻟﺘﻘﻮﻳﻢﻠﻰ ا
ﺟﮭﻭﻓﻖﺔ ﻋ٦٧٦٧
ﻛﺎﻧﻮﻧﻮ وا
ﺣدﯾد٠٣ ﯾﺗم اﺳﺗﺧدام ﻣﻌرف اﻟواﺟﮭﺔ ﻟﺗ:ﻣﻌرف اﻟواﺟﮭﺔ
Types of Address Inscription
IPv6 address is written in hexadecimal and consists
of groupings of 8 containing 4 hexadecimal digits or
8 groups of 16 bits each.
xxxx : xxxx : xxxx : xxxx : xxxx : xxxx : xxxx : xxxx
2001:0250:02FF:0210:0250:8BFF:FEDE:67C8
Leading zeros do not need to be written.
2001:250:2FF:210:250:8BFF: FEDE:67C8
٢٩ .٤ ﻭﻓﻖ ﺍﻟﺘﻘﻮﻳﻢ ﺍﻟﺴﻮﺭﻱ٦٧٦٧ ﻛﺎﻧﻮﻧﻮ٠٣
Types of Address Inscription
A double colon, at most one of which may appear in
any address, indicates multiple zero blocks.
FEDC: 0000:0000:0000:00DC:0000:7076:0010
FEDC:: DC:0:7076:10
Classless Interdomain Routing
IPv6 allows slash or CIDR notation.
FDEC::BBFF:0:FFFF/60
٣٠ .٤ ﻭﻓﻖ ﺍﻟﺘﻘﻮﻳﻢ ﺍﻟﺴﻮﺭﻱ٦٧٦٧ ﻛﺎﻧﻮﻧﻮ٠٣
Types of Address Inscription
In mixed networks of IPv6 and IPv4, the last four
bytes of the IPv6 address are sometimes written as an
IPv4 dotted quad address.
FEDC:BA98:7654:3210:FEDC:BA98:7654:3210
FEDC:BA98:7654:3210:FEDC:BA98:118.84.50.16
Unlike IPv4 with IPv6, all zeros and ones are legal
values for any field in an address.
٣١ .٤ ﻭﻓﻖ ﺍﻟﺘﻘﻮﻳﻢ ﺍﻟﺴﻮﺭﻱ٦٧٦٧ ﻛﺎﻧﻮﻧﻮ٠٣