0% found this document useful (0 votes)
18 views

NetLab-L2 3

The document discusses IP addressing and network devices. It covers network classes, reserved IP addresses, private IP addresses, subnet masks, broadcast addresses, CIDR notation, subnetting, VLSM, and examples of subnetting different IP address ranges with varying subnet masks.

Uploaded by

aloqab778030
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

NetLab-L2 3

The document discusses IP addressing and network devices. It covers network classes, reserved IP addresses, private IP addresses, subnet masks, broadcast addresses, CIDR notation, subnetting, VLSM, and examples of subnetting different IP address ranges with varying subnet masks.

Uploaded by

aloqab778030
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

IBB University Department of Electrical Engineering

Level: 4
Faculty of Engineering
Networks Lab

IPv4 Addressing
&
Network devices
Lect 2 & 3

Eng. Abeer Mohammed


Network Classes

TCP/IP defines five classes of IP addresses:

Class A, B, C, D, and E. each class has a range of valid IP address. IP addresses from the first three classes
(A, B and C) can be used for host addresses, the other two classes are used for other purposes – class D for
multicast and class E for experimental purposes.

▪ Number of networks and the hosts that permitted in the classes

 Some reserved IP addresses


• IP address 0.0.0.0
One of a few special-purpose address, it has several applications in networking. It identifies a
default route and more, it is a non-routable meta-address used to designate invalid, unknown, or
non-applicable target (a no particular address place holder). On PCs and client devices. A 0.0.0.0
address indicates the client is not connected to a TCP/IP network, and a device may give itself a
0.0.0.0 address when it is offline.

• Loopback addresses
 127.0.0.0 /8 (127.0.0.1 to 127.255.255.254)
 Commonly identified as only 127.0.0.1
 Used on a host to test if TCP/IP is operational.

2
• Link-Local addresses
 169.254.0.0 /16 (169.254.0.1 to 169.254.255.254)
 Commonly known as the Automatic Private IP Addressing (APIPA) addresses or self-assigned
addresses.
 Used by Windows DHCP clients to self-configure when no DHCP servers are available.
 Privet IP address
A private IP address is a range of non-internet facing IP addresses used in an internal network.

Notes:

❖ Subnet Mask
• The subnet mask is used in IPv4 and IPv6 to show what part of the address is the network portion
and what part of address is the host portion.
• It is a 32-bit number that distinguishes each octet in IP address.
• In IPv4 there are three default subnet masks corresponding to the three classes of IP address.
❖ Broadcast address

A broadcast address is an IP address that is used to target all systems on a specific subnet network instead of
single hosts. In other words, broadcast address allows information to be sent be all machines on a given
subnet rather than to a specific machine

❖ Net-id: the net-id denotes the address of the network.


❖ Host-id: the host-id denotes the address of the host attached to the corresponding network.
ʘ Number of networks = 2network_bits
ʘ Number of hosts = 2host_bits -2
ʘ Hops = 2host_bits (in change Oct)
ʘ Net ID = the IP that allocated as network address.
ʘ First IP = the valid IP that use to the first device in the network.
ʘ Last IP = the valid IP that use to the last device in the network.

3
IPv4 Subnetting

Subnetting is the strategy used to partition a single physical network into more than one smaller logical sub-
network into more than one smaller logical sub-networks (subnets). In other word, it is dividing a large
block of addresses into several contiguous sub-blocks and assigning these sub-blocks to different smaller
networks is called subnetting it is a practice that is widely used when classless addressing is done.

❖ Classful addressing

Classful addressing is a concept that divides the available address space of IPv4 into five classes namely A,
B, C, D & E. It concepts divide the address space into a fixed number of blocks and each block has a fixed
number of hosts.

Ex1: The IP address 192.168.0.0/24

IP = 192.168.0.0

Subnet mask = /24 = 255.255.255.0 = 11111111.11111111.11111111.00000000

Solu. Number of hosts = 2H – 2 = 28- 2 = 256 - 2 = 254

Number of networks = 2N = 20 = 1

Subnet (Net ID) First IP Last IP Broadcast IP

192.168.0.0 192.168.0.1 192.168.0.254 192.168.0.255

Ex2: The IP address 10.0.0.0/8

IP = 10.0.0.0/8

Subnet mask = /8 = 255.0.0.0 = 11111111. 00000000. 00000000.00000000

Solu. Number of hosts = 2H – 2 = 224- 2 = 16777216 - 2 = 16777214

Number of networks = 2N = 20 = 1

Subnet (Net ID) First IP Last IP Broadcast IP

10.0.0.0 10.0.0.1 10.255.255.254 10.255.255.255

4
❖ Classless addressing

Classless addressing is a concept of addressing the IPv4 addresses. It was adopted after the failure of
Classful addressing. The Classful addressing leads to wastage of addresses as it assigns a fixed-size block of
addresses to the customer. But, the classless addressing assigns a block of addresses to the customer
according to its requirement which prevents the wastage of addresses.

CIDR (Classless Inter-Domain Routing)

Classless Inter-Domain Routing, also called supernetting, is a way to more flexibly allocate IP addresses by
creating unique and more granular identifiers for networks and individual devices.

Ex 1: The IP address 192.168.0.0/25

IP = 192.168.0.0

Subnet mask = /25 = 255.255.255.128 = 11111111.11111111.11111111.10000000

Solu. Number of networks = 2N = 21 = 2

Number of hosts = 2H – 2 = 27- 2 = 128 - 2 = 126

Hops = 2H = 27= 128 or

= 256 – 128 = 128

Nu.of. NETs Subnet (net IP) First IP Last IP Broadcast IP

NET 1 192.168.0.0 192.168.0.1 192.168.0.126 192.168.0.127

NET 2 192.168.0.128 192.168.0.129 192.168.0.254 192.168.0.255

Ex 2: The IP address 192.168.0.0/26 (answer yourself)

5
Ex 3: The IP address 192.168.0.0/27

IP = 192.168.0.0

Subnet mask = /27= 255.255.255.224 = 11111111.11111111.11111111.11100000

Solu. Number of networks = 2N = 23 = 8

Number of hosts = 2H – 2 = 25- 2 = 32 - 2 = 30

Hops = 2H = 25= 32 OR 256 – 224 = 32

Nu.of. NETs Subnet (Net ID) First IP Last IP Broadcast IP

NET 1 192.168.0.0 192.168.0.1 192.168.0.30 192.168.0.31

NET 2 192.168.0.32 192.168.0.33 192.168.0.62 192.168.0.63

NET 3 192.168.0.64 192.168.0.65 192.168.0.94 192.168.0.95

NET 4 192.168.0.96 192.168.0.97 192.168.0.126 192.168.0.127

NET 5 192.168.0.128 192.168.0.129 192.168.0.158 192.168.0.159

NET 6 192.168.0.160 192.168.0.161 192.168.0.190 192.168.0.191

NET 7 192.168.0.192 192.168.0.193 192.168.0.222 192.168.0.223

NET 8 192.168.0.224 192.168.0.225 192.168.0.254 192.168.0.255

Ex 4: The IP address 192.168.0.109 /28

Find the network address (Net ID) from this IP address?

IP = 192.168.0.109

Mask = /28 = 255.255.255.240

Solu. 192.168.0.109 = 11000000. 10101000.00000000.01101101


And
255.255.255.240 = 11111111.11111111.11111111.11110000
=
11000000. 10101000.00000000.01100000

Net ID = 192.168.0.96

6
Ex 5: IP address 172.16.0.0 /17

IP = 172.16 .0.0

Mask = /17 = 255.255.128.0 = 11111111.11111111.10000000.00000000

Solu. Number of networks = 2N = 21 = 2

Number of hosts = 2H – 2 = 215- 2 = 23768 - 2 = 23766

Hops = 2H = 27= 128

Nu.of. NET Subnet (net IP) First IP Last IP Broadcast IP

NET 1 172.16 .0.0 172.16 .0.1 172.16 .127.254 172.16 .127.255


NET 2 172.16 .128.0 172.16 .128.1 172.16 .255.254 172.16 .255.255

Ex 6: IP address 172.16.0.0 /23

IP = 172.16 .0.0

Mask = /23 = 255.255.254.0 = 11111111.11111111.1111110.00000000

Solu. Number of networks = 2N = 27 = 128

Number of hosts = 2H – 2 = 29- 2 = 512 - 2 = 510

Hops = 2H = 21= 2 OR = 256 – 254 = 2

Nu.of. NET Subnet (net IP) First IP Last IP Broadcast IP

NET 1 172.16.0.0 172.16.0.1 172.16.1.254 172.16.1.255

NET 2 172.16.2.0 172.16.2.1 172.16.3.254 172.16.3.255

NET 3 172.16.4.0 172.16.4.1 172.16.5.254 172.16.5.255

………… ………. ………… ………… …………

NET 127 172.16.252.0 172.16.252.1 172.16.253.254 172.16.253.255

NET 128 172.16.254.0 172.16.254.1 172.16.255.254 172.16.255.255

7
VLSM (Variable Length Subnet Mask)

A Variable Length Subnet Mask (VLSM) is a numerical masking sequence, or IP address subset, based on
overall network requirements. A VLSM allows a network administrator to use long masks for networks
with few hosts and short masks for networks with multiple hosts. In other word, VLSM is a technique that
allows network administrators to divide an IP address space into subnets of different sizes, unlike simple
same-size subnetting.

Ex1: hosts = 500

Solu. Step 1: get the Mask

Number of hosts = 2H – 2 = 29- 2 = 512 – 2 = 510

H = 9, Mask = 11111111.11111111.11111110.00000000 = 255.255.254.0 =/23

Step 2: select the random IP address

IP address 10.50.20.22

Step 3: Make And between the random IP and Mask to get the Net IP

10.50.20.22 = 00001010.00110010.00010100.00010110
And
255.255.254.0 = 11111111.11111111.11111110.00000000
=
00001010.00110010.00010100.00000000
10.50.20.0
Net ID =

Step 4: get the broadcast IP

255.255.254.0 = 11111111.11111111.11111110.00000000

10.50.20.22 = 00001010.00110010.00010100.00010110

broadcast IP = 00001010.00110010.00010101.11111111

= 10.50.21.255

Subnet (Net ID) First IP Last IP Broadcast IP

10.50.20.0 10.50.20.1 10.50.21.254 10.50.21.255

8
Ex 2: hosts = 5000

Step 1: hosts = 2H – 2 = 213- 2 = 8192 – 2 = 8190

H = 13, Mask = 11111111.11111111.11100000.00000000 = 255.255.224.0 =/19

Step 2: IP 110.50.30.10

Step 3: 110.50.30.10 = 01101110.00110010.00011110.00001010


And
255.255.224.0 = 11111111.11111111.11100000.00000000
=
0 1101110. 000110010.00000000.00000000
Net ID = 110.50.0.0

Step 4:

255.255.224.0 = 11111111.11111111.11100000.00000000

110.50.30.10 = 01101110.00110010.00011110.00001010

broadcast IP = 01101110.00110010.00011111.11111111

= 110.50.31.255

Subnet (net IP) First IP Last IP Broadcast IP

110.50.0.0 10.50.0.1 10.50.31.254 10.50.31.255

Note:
Can get the broadcast IP by use the hops

hops = 2H = 25 = 32

9
192.168.1.0/24

100 hosts

100 hosts = 2h – 2 = 27 – 2 = 128 – 2 = 126

Mask = 111111111.111111111.111111111.10000000 = 255.255.255.128 = / 25

Hops = 2h = 27 = 128

Net ID = 192.168.1.0 / 25

First IP = 192.168.1.1

Last IP = 192.168.1.126

Broadcast IP = 192.168.1.127

Note: can get last IP from 0 + 126 = 126

50 hosts

50 hosts = 2h – 2 = 26 – 2 = 64 – 2 = 62

Mask = 111111111.111111111.111111111.11000000 = 255.255.255.129 = / 26

Hops = 2h = 26 = 64

Net ID = 192.168.1.128 / 26

First IP = 192.168.1.129

Last IP = 192.168.1.190

Broadcast IP = 192.168.1.191

Note: can get last IP from 128 + 62 = 190

10
24 hosts

24 hosts = 2h – 2 = 25 – 2 = 32 – 2 = 30

Mask = 111111111.111111111.111111111.11100000 = 255.255.255.224 = / 27

Hops = 2h = 25 = 30

Net ID = 192.168.1.192 / 27

First IP = 192.168.1.193

Last IP = 192.168.1.222

Broadcast IP = 192.168.1.223

10 hosts

10 hosts = 2h – 2 = 24 – 2 = 16 – 2 = 14

Mask = 111111111.111111111.111111111.11110000 = 255.255.255.240 = / 28

Hops = 2h = 24 = 16

Net ID = 192.168.1.224 / 27

First IP = 192.168.1.225

Last IP = 192.168.1.238

Broadcast IP = 192.168.1.239

192.168.1.0 /24

55 hosts

55 hosts = 2h – 2 = 26 – 2 = 64 – 2 = 62

Mask = 111111111.111111111.111111111.11000000 = 255.255.255.129 = / 26

Hops = 2h = 26 = 64
11
Net ID = 192.168.1.0 / 26

First IP = 192.168.1.1

Last IP = 192.168.1.62

Broadcast IP = 192.168.1.63

26 hosts

55 hosts = 2h – 2 = 25 – 2 = 32 – 2 = 30

Mask = 111111111.111111111.111111111.11100000 = 255.255.255.224 = / 27

Hops = 2h = 25 = 32

Net ID = 192.168.1.64 / 27

First IP = 192.168.1.65

Last IP = 192.168.1.94

Broadcast IP = 192.168.1.95

12 hosts

12 hosts = 2h – 2 = 24 – 2 = 16 – 2 = 14

Mask = 111111111.111111111.111111111.11110000 = 255.255.255.240 = / 28

Hops = 2h = 24 = 16

Net ID= 192.168.1.96 / 28

First IP = 192.168.1.97

Last IP = 192.168.1.110

Broadcast IP = 192.168.1.111

2 hosts

2 hosts = 2h – 2 = 22 – 2 = 4 – 2 = 2

Mask = 111111111.111111111.111111111.11111100 = 255.255.255.252 = / 30

Hops = 2h = 22 = 4

12
Net ID = 192.168.1.112 / 30

First IP = 192.168.1.113

Last IP = 192.168.1.114

Broadcast IP = 192.168.1.115

2 hosts

2 hosts = 2h – 2 = 22 – 2 = 4 – 2 = 2

Mask = 111111111.111111111.111111111.11111100 = 255.255.255.252 = / 30

Hops = 2h = 22 = 4

Net ID = 192.168.1.116 / 30

First IP = 192.168.1.117

Last IP = 192.168.1.118

Broadcast IP = 192.168.1.119

Region 1

Address space 10.1.0.0 /16

8000 hosts

8000 hosts = 2h – 2 = 213 – 2 = 8192 – 2 = 8190

Mask = 111111111.111111111.11100000.00000000 = 255.255.224.0 = / 19

Hops = 2h = 25 = 32
13
Net ID = 10.1.0.0 / 19

First IP = 10.1.0.1

Last IP = 10.1.31.254

Broadcast IP = 10.1.31.255

4000 hosts

4000 hosts = 2h – 2 = 212 – 2 = 4096 – 2 = 4094

Mask = 111111111.111111111.11110000.00000000 = 255.255.240.0 = / 20

Hops = 2h = 24 = 16

Net ID = 10.1.32.0 / 20

First IP = 10.1.32.1

Last IP = 10.1.47.254

Broadcast IP = 10.1.47.255

2000 hosts

2000 hosts = 2h – 2 = 211 – 2 = 2048 – 2 = 2046

Mask = 111111111.111111111.11111000.00000000 = 255.255.248.0 = / 21

Hops = 2h = 23= 16

Net ID = 10.1.48.0 / 20

First IP = 10.1.48.1

Last IP = 10.1.55.254

Broadcast IP = 10.1.55.255

Region 2

Address space 172.20.0.0 /16

500 hosts

500 hosts = 2h – 2 = 29 – 2 = 512 – 2 = 510

Mask = 111111111.111111111.111111110.00000000 = 255.255.254.0 = / 23


14
Hops = 2h = 21 = 2

Net ID = 172.20.0.0 /23

First IP = 172.20.0.1

Last IP = 172.20.1.254

Broadcast IP = 172.20.1.255

200 hosts

500 hosts = 2h – 2 = 28 – 2 = 256 – 2 = 254

Mask = 111111111.111111111.111111111.00000000 = 255.255.255.0 = / 24

Hops = 2h = 20 = 1

Net ID = 172.20.2.0 /24

First IP = 172.20.2.1

Last IP = 172.20.2.254

Broadcast IP = 172.20.2.255

100 hosts

100 hosts = 2h – 2 = 27 – 2 = 128 – 2 = 126

Mask = 111111111.111111111.111111111.10000000 = 255.255.255.128 = / 25

Hops = 2h = 27 = 128

Net ID = 172.20.3.0 /25

First IP = 172.20.3.1

Last IP = 172.20.3.126

Broadcast IP = 172.20.3.127

15
Network devices

Network devices are electronic devices which are required for communication and interaction between
devices on a computer network.

Repeater device

Repeater is an electronic device that receives a signal and retransmits it at a higher level or higher power,
so that the signal can cover longer distances

Hub Device
A Hub is a network hardware device for connecting multiple Ethernet devices together and making
them act as a single network segment.
If a hub receives a signal at any port, it resend it out of every port except that port.
A Hub works at the physical layer (layer 1).
A Hub transfers data at a maximum of 10 Mb/sec.

16
Switch Device
Ethernet Switch is a network hardware device for connecting multiple devices together.
Each port of the ethernet switch is considered as a segment.
A switch forwards the frame passed on the destination MAC address.
A switch works at the physical layer (layer 1) and the data link layer (layer 2).
A switch transfers data at a maximum of 10 Gb/sec.

Router device
A router is a networking device that forwards data packets between different networks.
Each port of the router is considered as a network.
A router forwards the packet passed on the destination IP address.
A router works at the physical layer (Layer 1), the data link layer (Layer 2) and the network layer
(Layer 3).

17
Server device
A Server is dedicated computer for a specific purpose, It provide services and functionality to other
computers.
A server has a motherboard that supports many processors and uses special RAMs called ECC rams
(Error correcting ram) for error checking and correction.
A Server has redundant power supply contains two (or more) power supply units inside it.

Firewall device

A firewall is a network security system that monitors and controls incoming and outgoing network traffic
based on predetermined security rules.

❖ There are two types of firewalls:

1. Network-based Firewalls (Hardware).

2. Host-based Firewall (Software).

18
Icons Devices

19

You might also like