IP Address Lecture 01
IP Address Lecture 01
CYU 07208
Method of Assessment:
Students will be assessed through continuous assessments (coursework) that comprise of ONE compulsory test,
quizzes and assignments, lab tests and end of semester examination at the end of the semester. Continuous
assessment carries 40% (forty marks) and a final examination carries 60% (sixty marks).
Recommended Readings:
1. Behrouz Forouzan. (2009). TCP/IP Protocol Sutite, 4th Edition. Oxford University Press, USA.
2. Tanenbaum, A.S., and Wetherall, D. J. (2010). Computer Networks, 5th Edition. Prentice Hall.
3. Peterson, L. L., and Davie, B. S. (2011). Computer Networks: A system Approach, 5th Edition. Morgan Kaufmann .
1
Network Layer Functions
Ii
The network layer is responsible for the delivery of packets from the
2
original source to the final destination.
Source-to-destination delivery
3
Network Layer Functions
Routing
4
The typical functionalities of network layer
5
IP Addresses
IP Addresses:
Classful Addressing
6
INTRODUCTION
At the network layer, we need to uniquely identify each device on the
Internet to allow global communication between devices
The identifer used in the IP layer of the TCP/IP protocol suite to identify
each device connected to the Internet is called Internet address
or IP address
7 5/5/2024
What is an IP Address?
Two devices on the Internet can never have the same address.
8
Address Space
…………..
addr1 …………..
addr15
addr2 ………….. …………..
…………..
addr41 addr226
addr31
………….. …………..
IP adresses 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 2N
9 5/5/2024
Address space rule
…………..
addr1 …………..
addr15
Theaddr2 …………..
address space in a protocol
…………..
…………..
That uses N-bits to define an
Address is: addr41 addr226
addr31
………….. 2 N …………..
Because each bit can have two different values (0 and 1) and
N bits can have 2N values
10
IPv4 address space
11
Notation
12
Binary Notation
To make the address more readable, one or more space is usually inserted
between each octet (8 bits) or byte
Example:
01110101 10010101 00011101 11101010
13
Figure 4-1
Dotted-decimal notation
Note that, because each byte (octet) is only 8 bits, each number in the
dotted decimal is between 0 and 255.
14
Hexadecimal Notation
75 95 1D EA
0x75951DEA
15 5/5/2024
Example 1
Solution
18 5/5/2024
Example 3 (continued)
Solution
In decimal notation each number <= 255
301 is out of the range
19
Example 4
Solution
0X810B0BEF or 810B0BEF16
0xC1831CFF or C1831CFF16
20 5/5/2024
IP address with appending port
number
158.128.1.108:25
the four octet before colon is the IP address
The number of colon (25) is the port number
21 5/5/2024
CLASSFUL ADDRESSING
IP address, when started, used the concept of classes, this architecture
Is called classful addressing. Later, new architecture called classless
addressing was introduced. However, most of the Internet is still using
classful addrssing and the migration is slow.
Each class occupy occupies some part of the whole address space
22 5/5/2024
In classful addressing the address space is
divided into 5 classes:
A, B, C, D, and E.
23 5/5/2024
Figure 4-3
24 5/5/2024
Figure 4-4
25 5/5/2024
Figure 4-2
26
Example 5
Class A has
231 = 2,147,483,648 addresses
27 5/5/2024
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.
28
Example 6
Solution
29 5/5/2024
Figure 4-5
30 5/5/2024
Example 7
Solution
•158.223.1.108
1st byte = 158 (128<158<191) class B
•227.13.14.88
1st byte = 227 (224<227<239) class D
31 5/5/2024
Figure 4-6
32 5/5/2024
Class and Blocks
Each class is divided into a fixed number of blocks, with fixed size.
Class A is divided into 128 blocks, with each block having a different
NetID.
– The first covers address from 0.0.0.0 – 0.255.255.255 (netid 0)
– The second covers 1.0.0.0 – 1.255.255.255 (netid 1)
– The last block covers 127.0.0.0 – 127.255.255.255 (netid 127)
Note, for each block the first byte (NetID) is the same, but the other 3
bytes (HostID) can take any value in the given range.
The first and the last blocks are reserved for special purposes.One
block (netid 10) is used for private addresses.The remaining 125
blocks can be assigned to organisation (total number of organisation)
Each block contains 16, 777, 216 addresses, organization should be
really large (larger than the needs of most organisation)
33
All-Zeros Address
0.0.0.0
34
All-Ones Address: Limited
Broadcast Address
255.255.255.255
35
Figure 4-7
Blocks in class A
36
Direct Broadcast Address
The last address in a block or subblock (with the suffix set all to 1s) can be
used as adirect broadcast address.
Note that this address can be used only as a destination address in an IPv4
packet. If the router sends a datagram using a destination IPv4 address with
a suffix of all 1s, all devices on the network receive and process the
datagram.
37 5/5/2024
Network Address
The first address (with the suffix set all to 0s) in a block defines the
network address. It actually defines the network itself (cabling) and not
any host in the network.
38
Millions of class A addresses
are wasted.
39 5/5/2024
Class B
40
Figure 4-8
Blocks in class B
41
Many class B addresses
are wasted.
42 5/5/2024
Class C
44
The number of addresses in
a class C block
is smaller than
the needs of most organizations.
45 5/5/2024
Class D addresses
are used for multicasting;
there is only
one block in this class.
46 5/5/2024
Class E addresses are reserved
for special purposes;
most of the block is wasted.
47 5/5/2024
Network Addresses
Solution
49
Given the IP addresss 23.56.7.91; 132.6.17.85 and 201.180.56.5
find the begining address, class and blocks
50
In classful addressing,
the network address
(the first address in the block)
is the one that is assigned
to the organization.
51 5/5/2024
Mask
52 5/5/2024
Figure 4-10
Masking concept
53 5/5/2024
Figure 4-11
AND operation
54 5/5/2024
The network address is the
beginning address of each block.
It can be found by applying
the default mask to
any of the addresses in the block
(including itself).
It retains the netid of the block
and sets the hostid to zero.
55 5/5/2024
Default Mak
56 5/5/2024
Given the IP addresss 23.56.7.91; 132.6.17.85 and 201.180.56.5
find the begining address, class and blocks
57