0% found this document useful (0 votes)
46 views57 pages

IP Address Lecture 01

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

IP Address Lecture 01

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

Data Communications

CYU 07208

Sub – Enabling Outcomes:

1. Employ digital data transmission techniques in designing data communication.


2. Demonstrate knowledge of communication media in designing data exchange.
3. Apply data communications concepts in exchanging digital data.
Delivery Methods:
The course will be delivered using a combination of several classroom teaching strategies and
techniques including Lectures, Case Studies, Group Discussion, Labs/Tutorials.

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

 Logical addressing. The physical addressing implemented by the


data link layer handles the addressing problem locally. The network
layer adds a header to the packet coming from the upper layer, that
includes the logical address of the sender and receiver

 Routing. When independent networks or links are connected


together to create an internetwork (a network of networks) or a large
network, the connecting devices (called routers or gateways) route or
switch the packets to their final destination. It uses the Internet
Protocol (IP) for internetworking and routing

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

Anologous to telephone system, where each subscriber has a unique


Telephone number

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

An IP address is a 32-bit binary address that uniquely and universally


defines the connection of a host or a router to the Internet

7 5/5/2024
What is an IP Address?

An IP address is a 32-bit address.

The IP addresses 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.
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

The address space of IPv4 is


232
or
4,294,967,296.

11
Notation

There are three common notations to show an


IP address: Binary Notation, dotted-decimal,
and Hexadecimal notation

12
Binary Notation

The IP address is displayed as 32 bits.

To make the address more readable, one or more space is usually inserted
between each octet (8 bits) or byte

IP address refered to as a 32 bit address, 4-octet address or 4 byte address

Example:
01110101 10010101 00011101 11101010

13
Figure 4-1

Dotted-decimal notation

To make the IP address more compact and easier to read, often is


expressed with a decimal point m (dot) separating the bytes.

Note that, because each byte (octet) is only 8 bits, each number in the
dotted decimal is between 0 and 255.

14
Hexadecimal Notation

0111 0101 1001 0101 0001 1101 1110 1010

75 95 1D EA

0x75951DEA

15 5/5/2024
Example 1

Change the following IP address from binary


notation to dotted-decimal notation.
10000001 00001011 00001011 11101111
11101111
Solution
129.11.11.239
16
Example 2

Change the following IP address from


dotted-decimal notation to binary
notation:
111.56.45.78
Solution

01101111 00111000 00101101 01001110


17
Example 3

Find the error in the following IP Address


111.56.045.78
221.34.7.8.20

Solution

-There are no leading zeroes in


Dotted-decimal notation (045)

- We may not have more than four numbers

18 5/5/2024
Example 3 (continued)

Find the error in the following IP Address


75.45.301.14
1110010.23.14.67

Solution
In decimal notation each number <= 255
301 is out of the range

mixture of binary and dotted-decimal notation

19
Example 4

Change the following binary IP address to


Hexadecimal notation
10000001 00001011 00001011 11101111
11000001 10000011 00011011 11111111

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.

In classful adressing, the IP address space is devided into five classes:


A, B, C, D, and E

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

Finding the class in binary notation

We can find the classes, when IP address is given in binary or decimal

24 5/5/2024
Figure 4-4

Finding the address class

25 5/5/2024
Figure 4-2

Occupation of the address space

26
Example 5

Class A has
231 = 2,147,483,648 addresses

27 5/5/2024
Example 5

How can we prove that we have 2,147,483,648 addresses in


class A?

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

Find the class of the following IP addresses


00000001 00001011 00001011 11101111
11000001 00001011 00001011 11101111

Solution

•00000001 00001011 00001011 11101111


1st is 0, hence it is Class A
•11000001 00001011 00001011 11101111
1st and 2nd bits are 1, and 3rd bit is 0 hence, Class C

29 5/5/2024
Figure 4-5

Finding the class in decimal notation

30 5/5/2024
Example 7

Find the class of the following addresses


158.223.1.108
227.13.14.88
193.14.56.22
14.23.120.8
252.5.15.11

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

Netid and Hostid

In classful addressing, IP addreses are divided into Netid and Hostid

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

 The block 0.0.0.0, which contains only one single address, is


reserved for communication when a host needs to send an IPv4
packet but it does not know its own address.
 This is normally used by a host at bootstrap time when it does
not know its IPv4 address.
 The host sends an IPv4 packet to a bootstrap server (called
DHCP server using this address as the source address and a
limited broadcast address as the destination address to find
its own address

34
All-Ones Address: Limited
Broadcast Address
255.255.255.255

 The block 255.255.255.255, which contains one


single address, is reserved for limited broadcast
address in the current network.
 A host that wants to send a message to every other
host can use this address as a destination address
in an IPv4 packet
 However, a router will block a packet having this
type of address to confine the broadcasting to the
local network.

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.

This address is usually used by a router to send a packet to all hosts in a


specific network. All hosts will accept a packet having this type of destination
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

 Class B is divided into 16,384 blocks, with each block having a


different NetID.
– The first covers address from 128.0.0.0 – 128.0.255.255 (netid
128.0)
– The last block covers 191.255.0.0 – 191.255.255.255 (netid
191.255)
 Note, for each block the first two bytes (NetID) are the same, but the
other 2 bytes (HostID) can take any value in the given range.
 There are 16,384 blocks that can be assigned to organisation.
 Each block contains 65, 536 addresses, organization should be large
enough to use all these addresses.
 Class B address were designed for mid-size organizations

40
Figure 4-8

Blocks in class B

41
Many class B addresses
are wasted.

42 5/5/2024
Class C

 Class C is divided into 2,097,157 blocks, with each block having a


different NetID. 256 blocks are used for private addresses, leaving
2,096,896 blocks for assignment to organizations.
– The first covers address from 192.0.0.0 – 192.0.255.255 (netid
192.0.0)
– The last block covers 223.255.255.0 – 223.255.255.255 (netid
223.225.225)
 Note, for each block the first three bytes (NetID) are the same, but the
other 2 bytes (HostID) can take any value in the given range.
 There are 2,096,902 blocks that can be assigned.
 Each block contains 256 addresses (total number of organization that
can have class C address is 2,096,902)
 Class C address were designed for small organizations (needing less
43 than 256 address)
Figure 4-9
Blocks in 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

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
48
Example 8

Given the network address


132.21.0.0; 220.34.76.0 and 17.0.0.0
find the class, the block, and the range of the addresses

Solution

The 1st byte is between 128 and 191.


Hence, Class B
The block has a netid of 132.21.
The addresses range from
132.21.0.0 to 132.21.255.255.

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

• A mask is a 32-bit binary number.


• The mask is ANDeD with IP address to get
• The block address (Network address)
• Mask And IP address = Block Address

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

 Class A default mask is 255.0.0.0


 Class B default mask is 255.255.0.0
 Class C Default mask 255.255.255.0

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

You might also like