0% found this document useful (0 votes)
17 views33 pages

Chapter 4 - Dynamic and Static IP Addresses-2022

Uploaded by

fluffynoob1
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)
17 views33 pages

Chapter 4 - Dynamic and Static IP Addresses-2022

Uploaded by

fluffynoob1
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/ 33

Chapter 4

Dynamic and Static IP Addresses

Official (Open), Non-sensitive


Objectives
• Describe the difference between Static and
Dynamic IP Addresses.
• Describe the advantages and disadvantages of
static and dynamic IP addresses.
• Determine the range of valid host address.
• Describe the function of DHCP service.

Official (Open), Non-sensitive


Outline
• Static IP Addresses
• What are static IP addresses?
• Advantages?
• Disadvantages?
• Dynamic IP Addresses
• What are Dynamic IP addresses?
• Advantages?
• Disadvantages?
• Types of IP Addresses
• Network Address
• Broadcast Address
• Host Address
• Dynamic Host Configuration Protocol (DHCP)

Official (Open), Non-sensitive


Static and Dynamic IP Addresses
• IP addresses can be “static” or
“dynamic”.

• Static IP Addresses
• Fixed, always the same IP address even if the
host reboots.
• Dynamic IP Addresses
• Is not fixed. IP address of a host may change
after the host reboots.
Official (Open), Non-sensitive
What are “Static” IP Addresses?
• “Static” = “unchanging”.
• Therefore “Static IP Addresses”
are IP addresses that remain
unchanged.
• Static IP Addresses are often
“manually” allocated and
configured on hosts, but can
be done automatically too.
• Even if the host is rebooted,
the configured IP address is
preserved.
• The host always has the same IP
address.
Official (Open), Non-sensitive
Why do we use “Static IP Addresses”?
• Deterministic IP address – always the same IP
address, conveniently contactable from other
hosts.
My IP
I can easily Switch address is
contact Laptop C “static”.
because it has a Laptop A
fixed IP address.
Laptop C
Me too. I always
know where to Laptop B
find Laptop C.

• Example: A file server using static IP address is easy


for the clients to find it.

Official (Open), Non-sensitive


Disadvantages of Static IP
Addresses (1)
• Static IP addresses are convenient (easy to
contact), but they do come with problems:
• Not scalable
• Very often static IP addresses are configured
manually. This approach works well for small number
of hosts, but it is too laborious for large number of
hosts.
• Conflict of IP addresses
• There is high chance of configuring two or more
hosts with same IP address, causing “IP address
conflict”. Recall that each host must have an unique
IP address.
Official (Open), Non-sensitive
Disadvantages of Static IP
Addresses (2)
• Inconvenience for mobile devices
• For wireless networks, mobile devices are joining
and leaving the wireless network frequently in and
out of network frequently. It will be too much
trouble to configure and release IP addresses.

• Insufficient IP addresses
• Each static IP address is dedicated to a particular
host, hence cannot be relocated to other hosts when
it is not in use.
• May not have enough IP addresses for every host.

Official (Open), Non-sensitive


Dynamic IP Addresses (1)
• Dynamic IP addresses are assigned by the
network when a host is connected to the
network.
• The dynamic IP address allocated to a host may
be different each time the host is connected to
the network (not a fixed IP address).
When I joined Welcome to my
this network network. Your IP
yesterday, I was address is
given Network 88.88.88.44.
88.88.88.88.
Laptop A

Official (Open), Non-sensitive


Dynamic IP Addresses (2)
• Dynamic IP addresses are temporarily
allocated to a device. It is taken back when no
longer needed.
• Examples:
• a mobile phone leaves a Wi-Fi network.
• A laptop is disconnected from the Ethernet port on
the wall.
I will take back
that IP address
and re-use it for
I am leaving your
Laptop A another new
network. Bye.
comer.
Network

IP addr = 88.88.88.44

Official (Open), Non-sensitive


Why do we use “Dynamic IP
Addresses”?
• More efficient (less network administration works)
• Automatic IP address allocation and configuration (less
human intervention).

• Eliminate the problem of IP address conflict faced by


manually configured static IP addresses.

• IP addresses can be re-allocated, solving the IP


address scarcity problem.
• A small number of IP addresses can be shared by a large
group of users, as long as not too many of the users need
the IP address at the same.
Official (Open), Non-sensitive
Disadvantages of Dynamic IP
Addresses
• IP address is not fixed.
• This is bad for servers. The clients need to know
the IP address of the server in order to initiate
the connection.
• There are other problems to be discussed
later (see slide #30).

Official (Open), Non-sensitive


How to choose IP address for
manual/auto IP address setting? (1)
• Regardless of manual or automatic
configuration of IP address, we need to
select the correct range of IP addresses.
• Manual configuration
• Pick a valid IP address and configure the host
accordingly.
• Automatic Configuration
• Define a pool of usable IP addresses, and let the
network decide which is to be allocated to a host.

Official (Open), Non-sensitive


How to choose IP address for
manual/auto IP address setting? (2)
Example of valid IP
addresses: Network = 192.168.1.x
192.168.1.5 Network
192.168.1.99 Subnet mask = 255.255.255.0
192.168.1.234

• When choosing an IP address for manual or


automatic configuration, the network portion is
always fixed (defined by the network).
• Host portion can be anything between 00…001
and 11…110.
• Note: Host portion = 00…000 (all zeros) and host portion =
11…111 (all ones) cannot be used. See next few slides for the
reason.
Official (Open), Non-sensitive
Types of IP Addresses
• There are 3 types of IP addresses:
• Network address
• The address by which we refer to the network.
• Broadcast address
• A special address used to send data to all hosts in
the network.
• Host addresses **Automatically means excluding Network and broadcast
• The addresses assigned to the end devices in the
network.

Official (Open), Non-sensitive


Type 1: Network Address
• Network Address is an address in which all the bits in
the Host portion are ‘0’s.
• An address by which we refer to a network. This can be
considered as Network ID or Subnetwork Identifier.
• Example:
• 192.168.88.0/24 is a network address.
• Proof:
• 192.168.88.0 = 11000000 10101000 01011000 00000000
• Since the prefix length is 24 (given by “/24”), the IP address has 24
bits for Network portion, and 8 bits for Host portion.
• Since all the 8 bits in the Host portion are ‘0’s, this is a Network
Address. All are ‘0’s.
11000000 10101000 01011000 00000000
Network portion Host portion
Official (Open), Non-sensitive
Exercise:
Is this a Network Address?
• Given an IP address 224.55.65.0/22. Is this a Network
Address?
• Answer:
• 224.55.65.0 = 11100000 00110111 01000001 00000000
• Prefix length = 22, hence 22 bits belong to Network
portion and 10 bits belong to Host portion:
• 11100000 00110111 01000001 00000000
• Since one of the 10 bits in the Host portion is not ‘0’, this is
not a Network Address.
Not all are ‘0’s.

11100000 00110111 01000001 00000000


Network portion Host portion

There is a ‘1’.
Official (Open), Non-sensitive
Type 2: Broadcast Address
• Broadcast Address is an address in which all the bits in
the Host portion are ‘1’s.
• Broadcast Address is a special address that allows
communication to all the hosts in that network.
• Example:
• For network 100.88.99.0 /24, the broadcast address would be
100.88.99.255.
• Proof:
• 100.88.99.0 = 01100100 01011000 01100011 00000000
• Prefix Length = 24, hence the IP address has 24 bits for Network
portion, and 8 bits for Host portion.
• For a Broadcast Address, all the 8 bits in the Host portion are ‘1’s.
• Therefore, Broadcast Address is:
• 01100100 01011000 01100011 11111111
• 100 88 99 255 (proved)

Official (Open), Non-sensitive


Exercise:
Find the Broadcast Address
• Given an IP address 224.55.65.0/22. Find the Broadcast
Address for this network.
• Answer:
• 224.55.65.0 = 11100000 00110111 01000001 00000000
• Prefix length = 22, hence 22 bits belong to Network portion and
10 bits belong to Host portion: Take note of the difference.
• 11100000 00110111 01000001 00000000
• Making all the 10 bits in the Host portion to ‘1’s, the Broadcast
Address is:
• 11100000 00110111 01000011 11111111
• 224 55 67 255
• Therefore, the Broadcast Address is 224.55.67.255 (answer).
All are ‘1’s.

11100000 00110111 01000011 11111111


Network portion Host portion

Official (Open), Non-sensitive


Type 3: Host Address (1)
• Host Addresses are addresses assigned to the end
devices in the network.
• For a network with prefix length of m bits, there are:
• m bits in the Network portion, and
• (32-m)=n bits in the Host portion.
• With n bits in the Host portion, there are 2n possible
patterns, from 000…00 to 111…11.
• The first pattern, where all bits in the Host portion are
‘0’s (000…00) is reserved as the Network Address.
• The last pattern, where all bits in the Host portion are ‘1’s
(111…11) is reserved as the Broadcast Address.

Official (Open), Non-sensitive


Type 3: Host Address (2)
• Using 8-bit Host portion as a example, the patterns of the host portion
are:
• 00000000 (Cannot be used!!! Reserved for Network Address.)
• 00000001 (Can be used as Host Address – First valid Host Address)
• 00000010 (Can be used as Host Address)
• 00000011 (Can be used as Host Address)
• ….. (Can be used as Host Address)
• 11111100 (Can be used as Host Address)
• 11111101 (Can be used as Host Address)
• 11111110 (Can be used as Host Address – Last valid Host Address)
• 11111111 (Cannot be used!!! Reserved for Broadcast Address.)

• Out of the 2n patterns, two patterns cannot be used as Host Addresses:


• “000…00” and “111…11” are reserved as Network Address and Broadcast Address
respectively.
• Therefore, for a network with n bits in the Host portion, the number of
valid Host Addresses = 2n – 2.

No. of valid Host Addresses = 2n – 2

Official (Open), Non-sensitive


Exercise:
• Given an IP address 192.168.33.0/19, determine:
• (i) the Network Address of the network that this IP
address belongs to,
• (ii) the number of valid Host Addresses in this network,
• (iii) first valid IP address for this network,
• (iv) last valid IP address for this network,
• (v) the Broadcast Address for this network.

(i) network address = 192.168.32.0


(ii) 2^13-2= 8190
(iii) 192.168.32.1
(iv) 192.168.63.254
(v) 192.168.63.255

Official (Open), Non-sensitive


Answer
• (i)
• IP address = 192.168.33.0/19, therefore
Binary format = 11000000 10101000 00100001 00000000
• Prefix length = 19, hence Network portion is
11000000 10101000 001 (19 bits)
• No. of bits in Host portion, n = 32 – 19 = 13 bits
• For Network Addresses, all Host portion bits are ‘0’s.
• 00000 00000000
• Therefore, Network Address =
11000000 10101000 00100000 00000000
• 192 168 32 0
• Network Address = 192.168.32.0

Official (Open), Non-sensitive


Answer (cont’d)
• (ii)
• No. of bits in Host portion, n = 32 – 19 = 13 bits
• Number of valid Host Addresses = 2n – 2 = 213 – 2 = 8190

• (iii)
• First valid IP address is
11000000 10101000 00100000 00000001
• 192 168 32 1
• First valid Host Address = 192.168.32.1

Official (Open), Non-sensitive


Answer (cont’d)
• (iv)
• Last valid IP address is
11000000 10101000 00111111 11111110
• 192 168 63 254
• Last valid Host Address = 192.168.63.254

• (v)
• Broadcast Address is
11000000 10101000 00111111 11111111
• 192 168 63 255
• Broadcast Address = 192.168.63.255

Official (Open), Non-sensitive


Dynamic Host Configuration
Protocol (DHCP)
• In automatic IP address configuration, the network
allocates IP address to a host.

• The process of auto-configuration of IP address (and


other parameters) follows the Dynamic Host
Configuration Protocol (DHCP).

• DHCP is a client-server protocol that automatically


provides an host with an IP address and other
related configuration information (e.g. subnet mask,
default gateway, DNS server).
Official (Open), Non-sensitive
How does DHCP work? DHCP client i
Laptop A

• When a host is connected to a network, the “DHCP


client” service in the host makes a request (known
as “DHCP Discovery”) with the DHCP server in the
network for the network configuration information
(IP address, subnet mask, …etc).
Sure. Your IP address
Hi, I’ve just joined this is x.x.x.x; your subnet
network. Can someone mask is y.y.y.y; the
provide me the network Laptop A default gateway is
configuration information? z.z.z.z; …etc
DHCP Network
No IP address, no client
DHCP
subnet mask, no…etc server

Official (Open), Non-sensitive


Where is the DHCP Server?
• DHCP Server is a service (software) that may be
running on:
• a router
I am the DHCP
DHCP Network server.
client

- It is time dependent , usually a fixed amount of


Laptop A time for IP address of the host
-Can reserve IP address for Hosts via DHCP
• a computer Reservation on routers

DHCP Network I am the DHCP


client server.

Laptop A
Official (Open), Non-sensitive
Try this: Find out your DHCP Server
• Launch a DOS prompt window.
• Key in “IPCONFIG /ALL” <ENTER>

Official (Open), Non-sensitive


Disadvantages of using DHCP
• IP address is not fixed (discussed earlier).
• If the DHCP server fails, any host joining the
network will not be able to obtain an IP address.
• Security risk
• An unauthorised DHCP server may offer IP addresses to
users connecting to the network, and hence intercepting
information sent over that connection. This can lead to
“man in the middle attack”.
• See http://en.wikipedia.org/wiki/Man-in-the-middle_attack for
definition of “man in the middle attack”.

Official (Open), Non-sensitive


Can you mix Static and Dynamic IP
addresses?
• In a network, it is quite common to mix static and
dynamic IP addresses.
• Example: use static IP addresses for servers; use
dynamic IP addresses for user computers.
Router (DHCP server)
Static IP address File server
Static IP address

Laptop
Dynamic IP address
Network printer
Static IP address Desktop computer
Dynamic IP address
Official (Open), Non-sensitive
How to mix Static and Dynamic IP
Addresses? (1)
• Dynamic IP Addresses
• In the DHCP server, define a pool of IP addresses (for
example, 192.168.1.100 to 192.168.1.149) for dynamic
IP address allocation.
• Make sure that the pool of IP addresses is large enough to
serve the maximum possible number of hosts to connected to
the network.
• When a new connecting host requests for an IP address,
the DCHP server will pick one IP address from the pool
and makes the offers.
• The IP address that a host gets is not fixed. It depends
on what IP addresses are available when the request is
made.
Official (Open), Non-sensitive
How to mix Static and Dynamic IP
Addresses? (2)
• Static IP Addresses MAC ADDRESS SAME AS PHYSICAL ADDRESS !!

• Allocate IP addresses outside the dynamic IP


addresses pool (for example, 192.168.1.70 to
192.168.1.99) to a list of hosts that require static IP
addresses.
• For each host, reserve a fixed IP address for it.
• Based on the MAC address (physical address) of the
hosts, the DHCP server will offer a particular IP
address to the host when it makes the request.
• You may also manually configure the host with that
reserved IP address (i.e. not making request to the
DHCP server).

Official (Open), Non-sensitive

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy