0% found this document useful (0 votes)
20 views84 pages

Is 161 IP Addressing Lecture 3

This document provides information about network addressing at different layers of the TCP/IP model. It discusses: 1. The three types of addresses used - physical, IP, and port addresses which correspond to the link, internet, and transport layers. 2. Details on physical/MAC addresses including format and types (unicast, multicast, broadcast). 3. Explanation of IP address classes (A, B, C, D, E), network and host portions, and number of addresses supported. 4. Special IP addresses like network, broadcast, limited broadcast, loopback, and private addresses.

Uploaded by

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

Is 161 IP Addressing Lecture 3

This document provides information about network addressing at different layers of the TCP/IP model. It discusses: 1. The three types of addresses used - physical, IP, and port addresses which correspond to the link, internet, and transport layers. 2. Details on physical/MAC addresses including format and types (unicast, multicast, broadcast). 3. Explanation of IP address classes (A, B, C, D, E), network and host portions, and number of addresses supported. 4. Special IP addresses like network, broadcast, limited broadcast, loopback, and private addresses.

Uploaded by

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

IS 161- Fundamentals of Computer

Networks
(8 Unit)

Network Addressing
Lecture 3

IS 161- Fundamentals of Computer Networks.


Networks
Addressing
Addressing
Three different levels of addresses are used in
networks using TCP/IP protocols

Each address belongs to a specific layer of the


TCP/IP architecture
TCP/IP Protocol Suite
Addressing
Physical Address
 Known as MAC address on NIC
 Ethernet utilizes the 48-bit MAC address as its hardware
address
 A MAC address is most often represented in hexadecimal,
using one of two accepted formats:
00:43:AB:F2:32:13
0043.ABF2.3213
The first six hexadecimal digits of a MAC address identify the
manufacturer of the physical network interface.
The last six digits uniquely identify the host itself, and are
referred to as the host ID

 It is included in the frame used by the data link layer
 Format varies depending on the network. For
Ethernet it is 48-bits imprinted on the NIC
 Networks support three types of physical addresses
 Unicast: To be received by a single recipient
 Multicast: To be received by a group of recipients
 Broadcast: To be received by all systems
Addressing
Physical Address
 Ethernet supports all the three types of physical
addresses
 Some networks do not support the multicast and
broadcast physical addresses
IP Addressing
 At the application layer, we can think of an Internet as
a single network connecting hosts
 A universal identification system is needed
 An Internet is made of a combination of physical
networks (LANs and MANs) connected by routers
 The packets may travel from one physical network to
another using routers
 A host must be able to communicate with another
host without worrying about the physical network
must be passed through
 This means that hosts must be identified uniquely
and globally
 Each router must also be identified uniquely and
globally
IP Addressing
 The identification used in the IP layer (Internet
Layer) of the TCP/IP Protocol is the Internet
Address or IP address
 It is a 32-bit binary (4-bytes) address implemented
in software
 An IP address is a 32-bit address that uniquely
defines a host or a router on the Internet
 A device can have more that one IP address if
connected to more than one physical network
 Each NIC is connected to a physical network. A
computer can have more than one NIC
 IP address defines two parts:
 Network Identification (NetID)
 Host Identification (HostID)
IP Addressing
 The two parts of varying lengths depending on the
class of the network

 Dotted decimal is used in the form of w.x.y.z


 Each 0ctet is converted separately
 e.g.128.11.3.31
IP Addressing
IP address Classes
 There are five different IP address classes:
Class A, B, C, D and E
 Classes are defined to cover the need of different
types of organizations
Class A

 Firstoctet (8-bits) defines the NetID with the


leftmost bit defining the class A (it must be 0)
 The remaining 7-bits define different networks
 Hence theoretically there are 27 = 128 class A
networks
IP Addressing
Class A
 However, there are actually 126 class A networks
because two of the network addresses are
reserved
 The 24-bits are used to define the HostID
 Theoretically there are 224 = 16,777,216 hosts per
class A network
 However 2 HostID are reserved
 Class A addresses are designed for organizations
that may have huge number of computers
attached to the network
IP Addressing
Class B

 2 octets (16-bits) defines the NetID with the two


leftmost bits defining the class B (it must be 10)
 The remaining 14-bits define different networks
 Hence theoretically there are 214 = 16,384 class B
networks
 The 16-bits are used to define the HostID
 Theoretically there are 216 = 65,536 hosts per
class B network
 However two addresses are special addresses.
Class B addresses are designed to midsize
organizations
IP Addressing
Class C

 3 octets (24-bits) defines the NetID with the three


leftmost bits defining the class C (it must be 110)
 The remaining 21-bits define different networks
 Hence theoretically there are 221 = 2,097,152 class C
networks
 The 8-bits are used to define the HostID
 Theoretically there are 28 = 256 hosts per class C
network
 However two addresses are special addresses
 Class C addresses are designed for organizations with
small number of computers
IP Addressing
Class D

 Is defined for multicasting. There is no NetID and


HostID.
 The whole address is used for multicasting
Class E

 Class E is reserved by the Internet for special use


 There is no NetID or HostID
IP Addressing
 If the address is defined in decimal notation then we
have the following classes
A If the first number is between 0 and 127
(inclusive)
B If the first number is between 128 and 191
(inclusive)
C If the first number is between 192 and 223
(inclusive)
D If the first number is between 224 and 239
(inclusive)
E If the first number is between 240 and 255
(inclusive)
IP Addressing
Multihomed Devices
 An Internet address defines the node’s connection
to its network
 Any device connected to more than one network
must have more than one NIC and hence more than
one IP Address (one address for each network)
 A computer that is connected to different networks is
called a multihomed computer and will have more
than one IP address e.g. a Router is a multihomed
device
IP Addressing
Multihomed Devices
IP Addressing
Special Addresses
 Network Address
 In classes A, B & C, an address with a HostID of all
0s is not assigned to any host, it is reserved to
define the network address itself
 The network address is an address with the HostID
all set to 0s
 Direct Broadcast Address
 In classes A, B & C if the HostID is all 1s, the
address is called a Direct Broadcast address
 Used by a router to send a packet to all hosts in a
specific network
IP Addressing
Direct Broadcast Address
 All hosts will accept a packet having this type of
destination address
 Used by a router to send a packet to all hosts in a
specific network
 This address can be used only as destination address
IP Addressing
Limited Broadcast Address
 In class A,B & C, an address with all 1s for the NetID
and HostID is used to define a Broadcast address in
the current network
 A host which wants to send a message to every other
host can use this address as a destination address
 Router will block a packet having this type of address
to confine the broadcasting to the local network
 All devices on this network receive and process this
datagram
IP Addressing
Limited Broadcast Address
IP Addressing
This Host on This Network
 If an IP address is composed of all zeros, it means
this host on this network
 Used by a host at startup time when it does not
know its IP address
 The host sends an IP packet to a startup server
using this address as the source address and a
limited broadcast address as the destination
address to find its own address
 This can only be used as a source address
IP Addressing
This Host on This Network
IP Addressing
Specific Host on This Network
 An IP address with a NetID of all 0s means a
specific host on this network
 Used by a host to send a message to another host
on the same network
 It can only be used as a destination address
IP Addressing
Loopback Address
 An IP address with the first byte equal to 127 is used
for loopback
 This is an address used to test the software on a
machine
 When this address is used, a packet never leaves
the computer, it returns to the protocol software
 e.g. an application such as ping can send a packet
with loopback address to see if the IP software is
capable of receiving and processing a packet
 Can only be used as a destination address
IP Addressing
Unicast, Multicast and Broadcast Address
 Unicast Addresses
 Isone-to-one communication, when a packet is
sent from an individual source to an individual
destination
 e.g. from 129.8.14.12 to 134.18.14.121
 All
systems on the Internet should have at least
one unicast address
 Multicast Addresses
 Is one-to-many communication, when a packet
is sent from an individual source to a group of
destinations
IP Addressing
Multicast Addresses
 Is a class D address
 A system on the Internet can have one or more
multicast address in addition to its Unicast address
 The Internet Authorities have assigned some
multicast addresses to some specific groups
 e.g. For Teleconferencing the multicast addresses
start with 224.0.1 for Audio news 224.0.1.7
Broadcast Addresses
 Is one-to-all communication, when a packet is sent
from an individual source to all hosts
 The Internet allows broadcasting only at the local
level. No broadcasting is allowed at the global level
IP Addressing
Private Addresses
 If an organisation does not need access to the
Internet, there are three choices for its addressing
needs
1. Apply for a unique address and use it without
being connected to the internet
2. Can use class A, B or C addresses without
registering
3. Can use Reserved addresses for private
networks
IP Addressing
Private Addresses
 The Internet Authorities have reserved three
blocks of addresses for private networks
 Class A 10.0.0
 Class B 172.16 to 172.31
 Class C 192.168.0 to 192.168.255
 An organisation can use an address out of these
without any permission from the Internet
authorities
Subnetting
Subnetting
 The process of subdividing a network into two or
more networks
 It Is the division of a class-based network into
subnetworks
 Each subnet has its own subnetwork address
 We have seen that IP address has NetID and HostID
 To reach a host on the Internet, the network must be
reached first using the NetID then the host using the
HostID
 Class A, B, and C IP addresses have two levels of
hierarchy
Subnetting
 In many cases the two levels of hierarchy are not
enough
 For example an organisation with a class B
address e.g. 141.14.0.0
 The organisation has only one physical network
 The organisation has one network with many hosts
at the same level, not organized into groups
Problems with Classiful IP Addresses
 The original classful address scheme had a number
of problems
 Problem 1. Too few network addresses for large
networks
 Class A and Class B addresses are gone
 Problem 2. Two-layer hierarchy is not appropriate for
large networks with Class A and Class B addresses.
 Fix #1: Subnetting
Problems with Classiful IP Addresses
Problem 3. Inflexible. Assume a company requires
2,000 addresses
 Class A and B addresses are overkill
 Class C address is insufficient (requires 8 Class
C addresses)

 Fix #2: Classless Interdomain Routing (CIDR)


Problems with Classiful IP Address

 Problem 4: Exploding Routing Tables:


Routing on the backbone Internet
needs to have an entry for each
network address. In 1993, the size of
the routing tables started to outgrow
the capacity of routers.

 Fix #2: Classless Interdomain Routing


(CIDR)
Subnetting
Subnetting

 Packets from the internet will be delivered to


network 141.14.0.0 through the router
 Suppose the organisation wants to subdivide the
network into three subnetworks
 Subnetting is logical division of physical network
 However the Internet is not aware that the network
is divided into three subnetworks
 The three subnetworks still appear as a single
network to the rest of the internet
Subnetting
Subnetting

 Adding subnetworks creates an intermediate level


of hierarchy in the IP addressing system
 Now we have three levels: NetID, SubnetID and
HostID
 NetID: Is the first level and it defines the site
 SubnetID: is the second level and it defines the
subnetwork
 HostID: is the third level and it defines the host
connected to the subnetwork
Subnetting

 The routing of IP Datagrams now involved three


steps: Delivery to the site, delivery to the
subnetwork and delivery to the host
 In subnetting, a few of the leftmost bits in the
HostID bits are used for the SubnetID
Class B IP address
Subnetting

 Lets create the required three subnets on the


network 141.14.0.0
 All 0s and all 1s SubnetID are treated as special
addresses and therefore are not used
Subnetting

 How many bits are required for the SubnetID?


Lets say n bits
Subnetting
Subnetting
Subnetting
Subnetting
Subnetting Class C network
 A company with class C network: 203.152.74.0
need at least five subnets. Determine the possible
range of IP addresses for each subnet and the
maximum number of hosts for each subnet
Subnetting

 How many bits are required for the SubnetID?


 Lets say n bits
Subnetting
Subnetting
Subnetting
Subnetting
140.179.220.200
 Our example is a Class B address
 By default, the Network part of the address is
defined by the first 2 octets: 140.179.x.x
 By default, the Host part of the address is defined
by the last 2 octets: x.x.220.200

*Note that the network part of the address is also


known as the Network Address
Two Reserved Addresses on a Subnet:
 In order to specify the Network Address of a given
IP address, the Host portion is set to all “0”s:

◦ 140.179.0.0

 If all the bits in the Host portion are set to “1”s, then
this specifies the broadcast address that is sent to
all hosts on the network:

◦ 140.179.255.255
Masking and Subnet mask

 Masking is a process that extracts the network


address from the IP address
 Masking can be done whether we have subnetting
or not
 If no subnetting, masking extracts network address
from an IP address
 If subnetted, masking extracts subnetwork address
from an IP address
Masking and Subnet mask
Masking and Subnet mask
 In masking, AND operation is done on a 32-bit IP
address with another 32-bit number called the
mask, bit-wise
 A mask is an IP address which has 1s for all the
NetID bits and 0s for all the HostID bits
 Subnet masks are applied to an IP address to
identify the Network portion and the Host portion
of the address
Subnet masking
Subnet mask
 Lets use a class C IP address: 195.34.151.8
 The mask is 255.255.255.0
 Bit-wise AND operation
Default Subnet Masks

Class A - 255.0.0.0
11111111.00000000.00000000.00000000

Class B - 255.255.0.0
11111111.11111111.00000000.00000000

Class C - 255.255.255.0
11111111.11111111.11111111.00000000
58
Mr. LuwembaWednesday, May 31, 2023
Logical Bitwise AND Operation

 Remember our example?


 140.179.240.200

 It’s a Class B, so the subnet mask is:


 255.255.0.0

We need to look at this as our computer does so


we can perform the bitwise AND...
59
Mr. LuwembaWednesday, May 31, 2023
Logical Bitwise AND Operation

140.179.220.200 Class B address


255.255.0.0 Subnet Mask

In Binary:
10001100.10110011.11110000.11001000
11111111.11111111.00000000.00000000
10001100.10110011.00000000.00000000

By doing this, the computer has found that


our Network Address is 140.179.0.0
60
Mr. LuwembaWednesday, May 31, 2023
Another Example:

Suppose we have the address of: 206.15.143.89?

What class is it? Class C


What is the subnet mask?
255.255.255.0
What is the Network Address?
206.15.143.0
What is the host portion of the address?
0.0.0.89
61
Mr. LuwembaWednesday, May 31, 2023
How Does Subnetting Work?

Additional bits can be added (changed from 0 to


1) to the subnet mask to further subnet, or
breakdown, a network.

When the logical AND is done by the computer,


the result will give it a new Network (or Subnet)
Address.

Remember, an address of all “0”s or all “1”s


cannot be used in the last octet (or host portion).
All “0”s signify the Network Address and all “1”s
signify the broadcast address 62
Mr. LuwembaWednesday, May 31, 2023
So How Does This Work?

 We ask our ISP for a Class C license.

 They give us the Class C bank of 206.15.143.0

 This gives us 1 Network (206.15.143.0) with the potential


for 254 host addresses (206.15.143.1 to
206.15.143.254).

 But we have a LAN made up of 5 Networks with the


largest one serving 25 hosts.

 So we need to Subnet our 1 IP address...Mr. LuwembaWednesday,


63 May 31, 2023
So How Does This Work?

 To calculate the number of subnets


(networks) and/or hosts, we need to do
some math: Magic
Formula

 Use the formula 2n-2 where the n can


represent either how many subnets
(networks) needed OR how many hosts
per subnet needed.
64
Mr. LuwembaWednesday, May 31, 2023
So How Does This Work?

 We know we need at least 5 subnets. So 23-2 will


give us 6 subnet addresses (Network Addresses).

 We know we need at least 25 hosts per network.


25-2 will give us 30 hosts per subnet (network).

 This will work, because we can steal the first 3 bits


from the host’s portion of the address to give to
the network portion and still have 5 (8-3) left for
the host portion:

65
Mr. LuwembaWednesday, May 31, 2023
Break it down:

 Let’s go back to what portion is what:

We have a Class C address:


NNNNNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH

With a Subnet mask of:


11111111.11111111.11111111.00000000

We need to steal 3 bits from the host portion to give it


to the Network portion:
NNNNNNNN.NNNNNNNN.NNNNNNNN.NNNHHHHH 66
Mr. LuwembaWednesday, May 31, 2023
Break it down:

NNNNNNNN.NNNNNNNN.NNNNNNNN.NNNHHHHH

This will change our subnet mask to the following:


11111111.11111111.11111111.11100000

 Above is how the computer will see our new subnet mask,
but we need to express it in decimal form as well:

255.255.255.224 128+64+32=224

67
Mr. LuwembaWednesday, May 31, 2023
What address is what?

 Which of our 254 addresses will be a


Subnet (or Network) address and which
will be our host addresses?

 Because we are using the first 3 bits for


our subnet mask, we can configure them
into eight different ways (binary form):

68
Mr. LuwembaWednesday, May 31, 2023
What address is what?

 Which of our 254 addresses will be a Subnet (or


Network) address and which will be our host
addresses?

 Because we are using the first 3 bits for our


subnet mask, we can configure them into eight
different ways (binary form):
000 001
010 011
100 101
110 111 69
Mr. LuwembaWednesday, May 31, 2023
What address is what?

 We cannot use all “0”s or all “1”s


000 001
010 011
100 101
110 111

•We are left with 6 useable network numbers.

70
Mr. LuwembaWednesday, May 31, 2023
Network (Subnet) Addresses
Remember our values:
128 64 32 16 8 4 2 1 Equals
Now our 3 bit configurations:
0 01 H H H H H 32
0 10 H H H H H 64
0 11 H H H H H 96
1 00 H H H H H 128
1 01 H H H H H 160
1 10 H H H H H 192

71
Mr. LuwembaWednesday, May 31, 2023
Network (Subnet) Addresses
0 0 1 h h h h h 32
0 1 0 h h h h h 64
0 1 1 h h h h h 96
1 0 0 h h h h h 128
1 0 1 h h h h h 160
1 1 0 h h h h h 192

Each of these numbers becomes the Network


Address of their subnet...
72
Mr. LuwembaWednesday, May 31, 2023
Network (Subnet) Addresses
206.15.143.32
206.15.143.64
206.15.143.96
206.15.143.128
206.15.143.160
206.15.143.192

73
Mr. LuwembaWednesday, May 31, 2023
host Addresses
 The device assigned the first address will receive the first
number AFTER the network address shown before.

206.15.143.33 or 32+1
0 0 1 0 0 0 0 1

And the last address in the Network will look like this:

206.15.143.62
0 0 1 1 1 1 1 0

*Remember, we cannot use all “1”s, that isMr.the broadcast


74
LuwembaWednesday, May 31, 2023
address (206.15.143.63)
Host Addresses

 The next network will start at 206.15.143.64

 The first IP address on this subnet network will receive:


206.15.143.65
0 1 0 0 0 0 0 1

And the last address in the Network will receive: 206.15.143.94


0 1 0 1 1 1 1 0

*Remember, the broadcast address (206.15.143.95)


75
Mr. LuwembaWednesday, May 31, 2023
Can you figure out the rest?

Network: Host Range

206.15.143.32 206.15.143.33 to 206.15.143.62

206.15.143.64 206.15.143.65 to 206.15.143.94

206.15.143.96 206.15.143.97 to 206.15.143.126

206.15.143.128 206.15.143.129 to 206.15.143.158

206.15.143.160 206.15.143.161 to 206.15.143.190

206.15.143.192 206.15.143.193 to 206.15.143.222


76
Mr. LuwembaWednesday, May 31, 2023
How the computer finds the Network
Address:

200.15.143.89 An address on the subnet


225.225.225.224 The new subnet mask

 When the computer does the Logical Bitwise AND Operation it


will come up with the following Network Address (or Subnet
Address):

11001000.00001111.10001111.01011001= 200.15.143.89
11111111.11111111.11111111.11100000 = 255.255.255.224
11001000.00001111.10001111.01000000 = 200.15.143.64
This address falls on our 2nd SubnetMr. (Network)77
LuwembaWednesday, May 31, 2023
Review

 We have one class C license.


 We need to subnet that into 12 possible networks.
 Each network needs a maximum of 10 hosts.
 How many bits do we need to take?

24-2=14

4 bits need to be taken from the host portion and given


to the network portion.
78
Mr. LuwembaWednesday, May 31, 2023
Review

 Will that leave enough bits for the host


portion? We need a maximum of 10 on each
network…

24-2=14

 If we take 4 away, that leaves us with 4. That


is enough for our individual networks of 10
hosts each.
79
Mr. LuwembaWednesday, May 31, 2023
Review

 Our new subnet mask will look like this:


11111111.11111111.11111111.11110000
255.255.255.240 128+64+32+16= 240

 Our subnet, or network addresses will be:


206.15.143.16 206.15.143.32 206.15.143.48
206.15.143.64 206.15.143.80 206.15.143.96
206.15.143.112 206.15.143.128 206.15.143.144
206.15.143.160 206.15.143.176 206.15.143.192
206.15.143.208 206.15.143.224 80
Mr. LuwembaWednesday, May 31, 2023
A Few Rules…

1. Each device on a node has a unique MAC


address

2. Each device on a node needs a unique IP


address

3. All devices on the same physical segment


share a common network ID (subnet mask)

4. Each physical segment has a unique Network


ID (subnet mask)
81
Mr. LuwembaWednesday, May 31, 2023
Address Resolution Protocol (ARP)

 Before an IP packet can be forwarded to another


host, the MAC address (usually 6 bytes written in
hex (Ex: 02-FE-87-4A-8C-A9) of the receiving
machine must be known

 ARP determines the MAC addresses that


correspond to an IP address

 A router will choose direct paths for the network


packets based on the addressing of the IP frame it
is handling (different routes to different networks)
82
Mr. LuwembaWednesday, May 31, 2023
Direct and Indirect Routing

 Direct – when nodes are on the same


network

 Indirect – used when the network


numbers of the source and destination
do not match
 Packet must be forwarded by a node that
knows hot to reach the destination (a
router)
83
Mr. LuwembaWednesday, May 31, 2023
Masking and Subnet mask

 A subnet mask is an IP address which has 1s for all


the NetID and SubnetID bits and 0s for all the
HostID bits
 For example a Class C IP address with 3 bits used
as SubnetID, the subnet mask will be:

You might also like