Network Addressing
Prepared by : Pr RIAHLA
1
Network Addressing:
Purpose
• MAC Address
• IP Address
• Port Number
2
Prepared by : Pr RIAHLA
Network Addressing:
Types
Device Application
Addressing Addressing
Port Number
Transport Layer
Logical Physical
Address Address
IP Address MAC Address
Internet Layer (TCP/IP) Network Access Layer
Network Layer (OSI) (TCP/IP)
Data Link Layer (OSI)
Prepared by : Pr RIAHLA 3
We’ll do a simulation at the
end of the class
Prepared by : Pr RIAHLA 4
Network Addressing
Physical Addressing
(MAC)
Prepared by : Pr RIAHLA 5
MAC address
A MAC address (Media Access Control address) is a
unique identifier assigned to each network card or
device connected to a local network. This address is
used at the Layer 2 (Data Link layer) of the OSI
model to uniquely identify a device on a network,
such as a computer, router, printer, or even a
smartphone.
Prepared by : Pr RIAHLA 6
MAC address
• A device has a unique worldwide address (fixed MAC
address).
• IEEE 802.3 addresses are encoded on 48 bits (6 bytes).
3 Bytes: prefix 3 Bytes
Manufacturer Number Serial Number
OID (Organizationally Unique Identifier)
08:00:20:09:E3:D8 or 8:0:20:9:E3:D8
08-00-20-09-E3-D8 or 08002009E3D8
00:00:0C:XX:XX:XX Cisco.
08:00:20:XX:XX:XX Sun.
08:00:09:XX:XX:XX HP
Prepared by : Pr RIAHLA 7
Structure of a MAC Address
3 Bytes: prefix 3 Bytes
Manufacturer Number Serial Number
OID (Organizationally Unique Identifier) Assigned uniquely to each
manufacturer of the hardware device by the manufacturer
FF:FF:FF:FF:FF:FF
11111111:11111111:11111111:11111111:11111111:11111111
48 Bytes
Prepared by : Pr RIAHLA 8
MAC address
chassis number (or Vehicle
Identification Number, VIN)
Prepared by : Pr RIAHLA 9
Ethernet frame
Application
TCP
IP
Driver Ethernet
Prepared by : Pr RIAHLA 10
Specific MAC Addresses
Broadcast MAC Address: FF:FF:FF:FF:FF:FF
MAC source: 08:00:20:09:E3:D8
MAC destination: FF:FF:FF:FF:FF:FF MACa
MACa = 08:00:20:09:E3:D8
LAN
Prepared by : Pr RIAHLA 11
Specific MAC Addresses
It is commonly used in protocols like ARP (Address Resolution
Protocol) or DHCP (Dynamic Host Configuration Protocol) for
network discovery or configuration.
FF:FF:FF:FF:FF:FF
11111111:11111111:11111111:11111111:11111111:11111111
48 bits
Prepared by : Pr RIAHLA 12
Specific MAC Addresses
Multicast MAC Address: a special prefix: 01:00:5E
(for IPv4) or 33:33 (for IPv6)
Groupe
MAC source: 08:00:20:09:E3:D8 MACa
MAC destination: 01:00:5E:00:00:01
MACa = 08:00:20:09:E3:D8
Multicast MAC addresses are used to send
frames to a group of devices rather than to a
single device LAN
Prepared by : Pr RIAHLA 13
Specific MAC Addresses
unicast MAC address
refers to a specific MAC address that
identifies a single network device. the first
bit of the first byte set to 0, distinguishing
them from multicast or broadcast
addresses.
MAC source: 08:00:20:09:E3:D8
MAC destination: 00:00:0C:00:01:30 MACa
MACb
MACa = 08:00:20:09:E3:D8
MACb = 00:00:0C:00:01:30
LAN
Prepared by : Pr RIAHLA 14
Other Specific MAC Addresses
Locally Administered MAC Address: assigned to a device by
software or a network administrator, overriding the burned-in
address for physical devices. assigning the value of 1 to the second-
least-significant bit of the first byte of the address: example
address 06-00-00-00-00-00
Special Management MAC Addresses: Some MAC addresses are
specifically used for network management protocols or special
network functions. For example 01:80:C2:00:00:00 is used for
Spanning Tree Protocol (STP), which helps prevent loops in Ethernet
networks.
Reserved MAC Addresses: Some MAC address ranges are reserved
by IEEE and are not assigned to physical devices..
Prepared by : Pr RIAHLA 15
Other Specific MAC Addresses
Type I/G U/L OUI OUA
Bit 1 2 3–24 25–48
Function Recever: Point of Manufacturer Identifying
Unicast or issue identification the network
broadcast adapter
Prepared by : Pr RIAHLA 16
Other Specific MAC Addresses
Prepared by : Pr RIAHLA 17
Logical Addressing (IP)
Prepared by : Pr RIAHLA 18
IP Addressing
➢For routing data, it's necessary to identify the machines
connected to the network.
➢The address must be organized like a postal address:
Street Building
City
Prepared by : Pr RIAHLA 19
IP Addressing
➢The MAC address does not allow for network interconnection.
00:00:0C:00:01:30
08:00:20:09:E3:D8
It is necessary to add a logical address in the upper layer, assigned
by the network administrator.
Prepared by : Pr RIAHLA 20
IP Addressing
Vehicle Registration Number
Prepared by : Pr RIAHLA 21
IP Addressing
32 Bits
Netid (network portion ) Hostid (host portion)
l'ICANN (Internet Corporation for Assigned Names and Numbers)
http://www.adresseip.com
Prepared by : Pr RIAHLA 22
IP Addressing
Africa Algeria Europe Spain
Africa Tunisia Europe France
Africa Mali Europe Italy
Africa Network Europe Network
Prepared by : Pr RIAHLA 23
IP Addressing
Example
32 Bits
8bits
8bits 8bits 8bits 8bits
11000000.10101000.00000001.00101010
192.168.1.42
Prepared by : Pr RIAHLA 24
Packet/Datagram IP
Application
TCP
IP
Driver Ethernet
Prepared by : Pr RIAHLA 25
IP Addressing
IP Address Classes
0 8 16 24 31
A 0
Netid Hostid
B 10 Netid Hostid
C 1 10 Netid Hostid
D 1110 Multicast
E 11110 Réserved
Prepared by : Pr RIAHLA 26
IP Address Classes
Class A
0 8 16 24 31
A 0 Netid Hostid
Small Number of Networks and Many Machines
00000000.00000000.00000000.00000001 01111111.11111111.11111111.11111110
Prepared by : Pr RIAHLA 27
IP Address Classes
Class B
0 8 16 24 31
B 10 Netid Hostid
A Medium Number of Networks and Machines
10000000.00000000.00000000.00000001 10111111.11111111.11111111.11111110
Prepared by : Pr RIAHLA 28
IP Address Classes
Class C
0 8 16 24 31
C 110 Netid Hostid
Multiple Networks and Few Machines
11000000.00000000.00000000.00000001 11011111.11111111.11111111.11111110
Prepared by : Pr RIAHLA 29
IP Address Classes
Class First address Last address
A 0.0.0.1 127.255.255.254
B 128.0.0.1 191.255.255.254
C 192.0.0.1 223.255.255.254
D 224.0.0.1 239.255.255.254
E 240.0.0.1 247.255.255.254
Prepared by : Pr RIAHLA 30
Subnet Mask
• Used to separate the network and host portions of an address.
• You obtain the network address by performing a bitwise AND
operation between an IP address and the subnet mask.
IP Address Africa Algeria
A bitwise AND operation
Subnet Mask 11111111111111111 0000000000000000
=
Network address Africa 0000000000000
Prepared by : Pr RIAHLA 31
Default Subnet Mask
0 8 16 24 31
Class A Netid Hostid
Mask 11111111 00000000 00000000 00000000
255 .0.0.0
0 8 16 24 31
Class B 1 Netid Hostid
Mask 11111111 11111111 00000000 00000000
255.255.0.0
Prepared by : Pr RIAHLA 32
Default Subnet Mask
0 8 16 24 31
Class C Netid Hostid
Mask 11111111 11111111 11111111 00000000
255.255.255.0
Class Default subnet Mask
A 255.0.0.0
B 255.255.0.0
C 255.255.255.0
Prepared by : Pr RIAHLA 33
Specific IP addresses
Network Address: An IP address where the host portion
(hostid) contains only zeros
Don't change Network Address 00000000000000
Example
IP Adress Africa Algeria
Network Address Africa 00000000000000
Prepared by : Pr RIAHLA 34
Specific IP addresses
Broadcast address: An IP address where the host portion
(hostid) contains only ones
Don't change Network Address 1111111111111111
Example
IP Adress Africa Algeria
Network Adress Africa All countries!!!
Prepared by : Pr RIAHLA 35
IP Addressing: Example
Address of a machine: 192.168.100.1
The subnet mask: ?????????
Where is the network part: ?????????
Where is the Host Party?: ?????????
Network Address: ?????????
Broadcast address: ?????????
Prepared by : Pr RIAHLA 36
IP Addressing: Example
192.168.100.1
11000000. 10101000. 01100100. 00000001
Prepared by : Pr RIAHLA 37
IP Addressing: Example
subnet Mask?
Full address: 192.168.100.1
What is the
class of this
Address?
Class C
11000000
Prepared by : Pr RIAHLA 38
IP Addressing: Example
Address of a machine: 192.168.100.1
The subnet mask: 255.255.255.0
Where is the network part: ?????????
Where is the Host Part?: ?????????
Network Address: ?????????
Broadcast address: ?????????
Prepared by : Pr RIAHLA 39
IP Addressing: Example
Network/Machine part
0 8 16 24 31
Class C Netid Hostid
11000000. 10101000. 01100100. 00000001
Our Address: 192.168.100.1
SO
Network Part: 192.168.100
Host Part: 1
Prepared by : Pr RIAHLA 40
IP Addressing: Example
Address of a machine: 192.168.100.1
The subnet mask: 255.255.255.0
Where is the network part: 192.168.100
Where is the Host Part?: 1
Network Address: ?????????
Broadcast address: ?????????
Prepared by : Pr RIAHLA 41
IP Addressing: Example
Network Address
Our Address : 192.168.100.1
0 8 16 24 31
Class C Netid Hostid
Network Netid 00000000
Address
11000000. 10101000. 01100100. 00000000
SO
Network Address: 192.168.100.0
Prepared by : Pr RIAHLA 42
IP Addressing: Example
Address of a machine: 192.168.100.1
The subnet mask: 255.255.255.0
Where is the network part: 192.168.100
Where is the Host Part?: 1
Network Address: 192.168.100.0
Broadcast address: ?????????
Prepared by : Pr RIAHLA 43
IP Addressing: Example
Broadcast Address
Our Adress : 192.168.100.1
0 8 16 24 31
Class C Netid Hostid
Broadcast
Netid 11111111
Address
11000000. 10101000. 01100100. 11111111
So
Broadcast: 192.168.100.255
Prepared by : Pr RIAHLA 44
IP Addressing: Example
Address of a machine: 192.168.100.1
The subnet mask: 255.255.255.0
Where is the network part: 192.168.100
Where is the Host Part?: 1
Network Address: 192.168.100.0
Broadcast address: 192.168.100.255
Prepared by : Pr RIAHLA 45
IP Addressing: Example
We want to see that in
reality
Prepared by : Pr RIAHLA 46
IP Addressing: Example
This network has
the following
address:
192.168.100.0
192.168.100.12
192.168.100.22
EOOOO, 192.168.100.192
EVERYONE
192.168.100.1 192.168.100.120
192.168.100.255
Prepared by : Pr RIAHLA 47
Subnet Addresses
Netid Hostid
Network Address Subnet Host
Addresses
Africa Algeria Oran
Prepared by : Pr RIAHLA 48
Subnet Addresses
Example: "Let’s assume we have a Class B
network. We therefore have two bytes available for
host addresses, allowing for 65,534 possible hosts
(the addresses x.x.0.0 and x.x.255.255 are
reserved). This would result in a large number of
machines on the same network.".
0 8 16 24 31
Network Address Subnet Host
Addresses
Prepared by : Pr RIAHLA 49
Subnet Addresses
128.10.1.
.2 .3 .4
.1
Internet 128.10.0.0
R
.1
128.10.2. .5 .6 .7
Prepared by : Pr RIAHLA 50
Subnet Addresses
Example
172.16.19.40/21
➢ What is the subnet mask for this address?
255.255.248.0
➢ How many bits have been reserved for private subnets?
5 bits
➢ How many private subnets are available?
32
➢ How many hosts can each subnet have?
2046
➢ What is the subnet address in the example?
172.16.16.0.
➢ "What is the broadcast address of the subnet in the example?
172.16.23.255
Prepared by : Pr RIAHLA 51
Subnet Addresses
Example
For the following address: 130.200.45.225, provide:
1. The address class:
2. The default network mask:
3. The network address:
4. The modified mask if the network has 60 subnets:
5. The subnet address and its number:
6. The machine number in the subnet:
7. The broadcast address for the machine:
8. The usable address ranges for the first two
subnets:
Prepared by : Pr RIAHLA 52
Subnet Addresses
Example
Given the following network address: 192.10.10.0, the
following subdivision is needed:
Number of required subnets: 14
Number of usable machines required: 14
a) Address class:
b) Default mask:
c) Custom subnet mask:
d) Total number of subnets:
e) Total number of machine addresses:
f) Number of usable machine addresses:
g) Number of borrowed bits for the subnet:
h) What are the 4th and 9th subnet ranges?
i) What is the 8th subnet?
j) What is the broadcast address for the 13th subnet?
k) How many broadcast domains can be created?
53
Subnet Addresses
Example
Given the following network address: 192.10.10.0, the
following subdivision is needed:
Number of required subnets: 14
Number of usable machines required: 14
2- What is the last valid host address on the subnet
172.16.216.192/26?
3- What is the first valid host address on the subnet
172.25.10.18 255.255.248.0?
4- How many subnets and hosts per subnet can be obtained from
the network 172.17.0.0 255.255.255.128?
54
Subnet Addresses
Example
1. From a network ID and a desired number of
subnets, calculate the subnet mask and the
number of hosts per subnet:
•Network ID: 200.63.24.0 and 2 subnets:
•Network ID: 148.25.0.0 and 37 subnets:
•Network ID: 210.206.202.0 and 60 subnets:
55
Subnet Addresses
Example
2. In this exercise, the maximum number of
hosts per subnet is given. Calculate the subnet
mask and the number of possible subnets.
•Network 222.53.25.0 and a maximum of 100 hosts
per subnet:
•Network 10.0.0.0 and a maximum of 100 hosts per
subnet:
•Network 223.21.25.0 and a maximum of 14 hosts per
subnet:
56
Subnet Addresses
Example
3. Given an IP address and a subnet mask,
determine the host IP range that includes this
address.
•IP Address: 200.53.64.7 with the mask
255.255.255.0
•IP Address: 10.25.68.2 with the mask 255.255.224.0
•IP Address: 131.107.56.25 with the mask
255.255.248.0
57
Subnet Addresses
Example
4. Which subnet includes the address
206.168.1.96 as a usable host address?
•206.168.1.32/28
•206.168.1.64/26
•206.168.1.32/27
•206.168.1.64/29
58
Subnet Addresses
Example
5. A company has a network address of
203.16.1.64 with a subnet mask of
255.255.255.192. The company wants to create
two subnets that will contain 10 hosts and 18
hosts, respectively. What are the two networks
that will allow this?
•203.16.1.64/27
•203.16.1.128/27
•203.16.1.16/28
•203.16.1.192/28
•203.16.1.96/28
59
Subnet Addresses
Example
6. What subnet mask allows hosting 510 hosts
on the network with IP address 172.30.0.0?
• 255.255.0.0
• 255.255.248.0
• 255.255.252.0
• 255.255.254.0
• 255.255.255.0
• 255.255.255.128
60
Subnet Addresses
Example
7. What IP address / subnet mask combination
identifies the IP addresses between
191.50.128.0 and 191.50.159.255?
•191.50.128.0 / 255.255.224.0
•191.50.128.0 / 255.255.255.224
•191.50.128.0 / 255.255.0.0
•191.50.128.0 / 255.255.192.0
•191.50.128.0 / 255.255.255.192
61
How to Design a private
network ?
•If the private network will NEVER be interconnected
with others than You can use any address.
•Else The private network can be interconnected via a
router interface. In this case, Reserved addresses for this
purpose must be used :
Class Mask Network address
A 255.0.0.0 10.0.0.0 - 10.255.255.255
B 255.255.0.0 172.16.0.0 - 172.31.255.255
C 255.255.255.0 192.168.0.0 - 192.168.255.255
Prepared by : Pr RIAHLA 62
Network Addressing
Application Addressing
(Port)
Prepared by : Pr RIAHLA 63
Port Number
Packet to 199.7.55.3
Prepared by : Pr RIAHLA 64
Port Number
I found the building
using its IP address,
but which door!!!!?
Prepared by : Pr RIAHLA 65
Port Number
• Propose a numbering system for each application: ports.
• "This number is written using 2 bytes, which gives 65,535 possible ports."
• 1-1024: Reserved ports
• 1025-65535: Dynamic or
Ephemeral Ports
Packet to 199.7.55.3
Port 3
Prepared by : Pr RIAHLA 66
Port Number
"I want to search on Google, so: Destination
Port: 80 (reserved for a web server)"
Port:80
Port:25
"Next time, I will send
an email, so I will
contact port 25."
Prepared by : Pr RIAHLA 67
Simulation
Prepared by : Pr RIAHLA 68