Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
LEC
Physical Layer
1
2/9/2020
ROUTER, routes
mail server
the packet basing
to Internet on IP address
web server
• As every letter must have all parts of the address written on it, similarly every
packet must have addresses of all layers to be able to be delivered to the
correct destination process.
• Source Address is also required for all Layers in the letters/packets for
reply/response.
2
2/9/2020
3
2/9/2020
4
2/9/2020
MAC Addresses
• 48 bit hex decimal value
• c:\> ipconfig / all ( to see your Mac addresses of all interfaces)
5
2/9/2020
MAC Addresses
• A network node with multiple NICs; each NIC must have a unique MAC address
LAN
(wired or
wireless) = NIC (Network Interface Card)
71-65-F7-2B-08-53
58-23-D7-FA-20-B0 adapter
0C-C4-11-6F-E3-98
Network Administrators
LAYER 3 ADDRESS: IP Address Requires Planning
6
2/9/2020
IPv4 ADDRESSES
• Who should Have an IP Address?
– IP Address is given to only those devices which have layer 3 in them. e.g Router, Computer,
Camera…… but what about Switch, hub ?
IP ADDRESS
• IPv4 addresses are 32 bit binary addresses (divided into 4 octets)
• ( 32 bits = 4 Octets of 8 bits each)
192 . 168 . 1 . 3
7
2/9/2020
• Similarly, An IPv4 address has two components, the network part and the host part.
– IP Address = 192.168.1.3
01100000 . 10101000 . 00000001. 00000011
Network bits Host bits
Some of the 32 Bits represent Network and Remaining bits represent Host Part in a IP
Address of 32 bits. It is important to mention here that here the separation of NW/HOST
part is in bits and not in digits ( as in cell phone separation is in digits).
Lt Col Dr HASNAT KHURSHID
SUBNET MASK
– QUESTION: How to determine which bits will depict NETWORK and which bits will
depict HOST part in an IP Address?
– Solution: Use a Mask of 1’s and 0’s where 1’s will depict Network and 0’s will
depict Host part. This Mask is known Subnet Mask.
– IP Address = 192.168.1.3
01100000 . 10101000 . 00000001. 00000011
11111111 . 11111111 . 111111111. 00000000 Subnet Mask. 255.255.255.0
Network Host
– IP Address = 128.1.0.1
10000000 . 00000001 . 00000000. 00000001
11111111 . 111111111 . 00000000. 00000000 Subnet Mask. 255.255. 0. 0
Network Host
Lt Col Dr HASNAT KHURSHID
8
2/9/2020
SUBNET MASK
– So an IPV4 Address has two components
• IP ADDRESS itself and a SUBNET MASK
– IP Address = 192.168.1.3
01100000 . 010101000 . 00000001. 00000011
– Note: Subnet mask will always have contiguous 1’s on the left. i.e it can
NOT be 10111101.111…..
– Subnet Mask is also specified using CIDR notation as / xx
( = number of 1’s in subnet Mask) Example: 192.168.1.3 / 24
9
2/9/2020
IPv4 ADDRESSES
• Infact we can also see that
– Network address: is an IPv4 address with all host bits are "0“
– Broadcast address: is an IPv4 address with all host bits are "1“
MCNA -Executive
– Uptill 1997? The complete 32 bit range of IP addresses was divided into
blocks, known as Class A, Class B, Class C. with fixed subnet masks as
– 255.255.255.0 (Class C) , (small networks 255 users)
– 255.255.0.0 (Class B) , ( medium networks ? Users)
– 255.0.0.0 (Class A) (Large networks ? Users)
– Problem with Classful Addressing ?.....
– But in 1997 this system was abolished and CIDR was introduced. Now
any number of bits can be used for NW and Host bits.
10
2/9/2020
IP ADDRESS ALLOC - EX
Given Block : 192.168.1.0 / 24
NW Address : 192.168.1.0
HOST Range : 192.168.1.1 till 192.168.1.254
Wateen mail server
Internet 192.168.1.11
255.255.255.0
172.xx.xx.xx web server
172.xx.xx.xx
192.168.1.1
255.255.255.0
192.168.1.10
255.255.255.0
192.168.1.2
255.255.255.0
192.168.1.3
255.255.255.0
IP ADDRESS ALLOC
Given Block : 192.168.1.0 / 24 DHCP: Dynamic Host Control Protocol
NW Address : 192.168.1.0 enables auto allocation of IP Addresses
HOST Range : 192.168.1.1 till 192.168.1.254 from a pool. e.g in your houses, cellphones.
Wateen mail server
Internet 192.168.1.11
255.255.255.0
172.xx.xx.xx web server
172.xx.xx.xx
192.168.1.1
255.255.255.0
192.168.1.10
255.255.255.0
192.168.1.2
255.255.255.0
192.168.1.3
255.255.255.0
11
2/9/2020
SUBNET MASK
EXAMPLE
• Extracting the Network Address from any given Host Address
– IP Address = 192.168.1.3
• 01100000 . 010101000 . 00000001. 00000011
SUBNET MASK
EXAMPLE
• Extracting the Network Address from any given Host Address
– IP Address = 10.20.15.5
???????? . ????????. ????????. ????????
– Subnet Mask = 255.0.0.0
????????. ????????. ????????. ????????
– Network Address = ? .?.?.?
(Logical AND op b/w IP and SUBNET MASK)
12
2/9/2020
SUBNET MASK
EXAMPLE
• Extracting the Network Address from any given Host Address
– IP Address = 10.20.15.5
00001010. 00010100. 00001111. 00000101
– Subnet Mask = 255.0.0.0
11111111. 00000000. 00000000. 00000000
– Network Address = 10.20.15.5
(Logical AND op b/w IP and SUBNET MASK)
SUBNET MASK
EXAMPLE
• Find the Network address ?
– Host IP Address of some host in the NW is = 10. 0.115.140 / 8
13
2/9/2020
IPv4 ADDRESSES
• IP Addressing schemes
– Classfull Addressing Scheme
• Used in INTERNET from 1981-1993
14
2/9/2020
CLASSFUL ADDRESSING
-2 is for subtracting 2 x Not Host-useabe addresses i.e Network Address & Broadcast Address
15
2/9/2020
16
2/9/2020
17
2/9/2020
• "Class C" IPv4 addresses are commonly used for small to mid-
size businesses
• Three left most bits of the left most octet of a "Class C" network is
reserved as "110“
• The first three octets of a "Class C" IPv4 address is used to
identify the Network and the remaining one octet is used to
identify the host in that particular network:-
– (Network.Network.Networkt.Host)
18
2/9/2020
• Four left most bits of the left most octet of a "Class D" network is reserved
as "1110“
• Other 28 bits are used to identify the group of computers the multicast
message is intended for
• The min possible value for the left most octet in binaries is 11100000
(decimal equivalent is 224) and the max possible value for the leftmost
octet is 11101111 (decimal equivalent is 239)
• Therefore for a "Class D" IPv4 address, leftmost octet must have a value
between 224-239 (224.X.X.X to 239.X.X.X)
19
2/9/2020
• Class E is used for experimental purposes only and you cannot assign these
IPv4 addresses to your devices
• Four left most bits of the left most octet of a "Class E" network is reserved as
"1111"
• The min possible value for the left most octet in binaries is 11110000 (decimal
equivalent is 240) and the max possible value for the leftmost octet is
11111111 (decimal equivalent is 255)
• Therefore for a "Class E" IPv4 address, leftmost octet must have a value
between 240-255 (240.X.X.X to 255.X.X.X)
A typical org requires mote then 255 addresses so it is allocated Class B Block but it did
not require 65536 addresses, so many addresses are wasted.
We can not afford that wastage anymore ( IP Addresses are valuable now)
Lt Col Dr HASNAT KHURSHID
20
2/9/2020
Solution - CIDR
• IP Addressing schemes
– Classfull Addressing Scheme
• Used in INTERNET from 1981-1993
Solution - Subnetting
Host Range
Class Network Adds Broadcast Adds # of Hosts subnet Mask CIDR
First Last
21
2/9/2020
Solution - Subnetting
• Example
– 192.168.1.0/24 (255.255.255.0)
• 01100000 . 010101000 . 00000001. 00000000
0
• 11111111 . 11111111. 11111111 . 0000000
Example- Subnetting
Host Range
Class Network Adds Broadcast Adds # of Hosts subnet Mask CIDR
First Last
22
2/9/2020
Example- Subnetting
• For 4 x subnets borrow 2 bits from the host part of subnet mask
• Example
– 192.168.1.0/26 (255.255.255.192)
Host Range
Class Network Adds Broadcast Adds # of Hosts subnet Mask CIDR
First Last
Example- Subnetting
• For 8 x subnets borrow 3 bits from the host part of subnet mask
• Example
– 192.168.1.0/27 (255.255.255.224)
Host Range
Class Network Adds Broadcast Adds # of Hosts subnet Mask CIDR
First Last
… … … … … … …
… … … … … … …
23
2/9/2020
Example- Subnetting
• For 8 x subnets borrow 3 bits from the host part of subnet mask
• Example
– 192.168.1.0/27 (255.255.255.224)
Host Range
Class Network Adds Broadcast Adds # of Hosts subnet Mask CIDR
First Last
… … … … … … …
… … … … … … …
Given
B 172.16.0.0 172.16.0.1 172.16.255.254 172.16.255.255 65534 255.255.0.0 /16
24
2/9/2020
Subnetting
CIDR
• Even much more IPv4 addresses are wasted in the case of Class
A, where total usable IPv4 addresses per network is 16777214
((2^24) - 2)
• The original "IPv4 Class A networks" uses 8 bits to represent the
network part, "Class B networks" uses 16 bits to represent the
network part and "Class C networks" uses 24 bits to represent the
network part
• CIDR replaced these categories with a more generalized network
prefix
25
2/9/2020
CIDR
VLSM
26
2/9/2020
VLSM
EXAMPLE VLSM
Host Range
CLASS Network Adds First Last Broadcast Adds # of Hosts subnet Mask CIDR
Given
C 192.168.1.0 192.168.1.1 192.168.1.254 192.168.1.255 256 - 2 255.255.255.0 /24
2 Subnets
subnet 1 192.168.1.0 192.168.1.1 192.168.1.126 192.168.1.127 128 – 2 255.255.255.128 /25 pick this
subnet 2 192.168.1.128 192.168.1.129 192.168.1.254 192.168.1.255 128 - 2 255.255.255.128 /25 divide this further
2 sub-sub-nets
subsubnet 1 192.168.1.128 192.168.1.129 192.168.1.190 192.168.1.191 64 - 2 255.255.255.192 /26 pick this
subsubnet 2 192.168.1.192 192.168.1.193 192.168.1.254 192.168.1.255 64 - 2 255.255.255.192 /26 divide this further
27
2/9/2020
VLSM
• Step 1
– Divide the two networks equally with 128 IPv4 addresses in each network
using 255.255.255.128 subnet mask (192.168.10.0/25)
– Two subnets each with 128 IPv4 addresses will be:-
• 192.168.10.0/25
• 192.168.10.128/25
VLSM
• Step 2
– Divide second subnet (192.168.10.128/25) obtained from the Step 1 again
into two Networks, each with 64 IP Addresses using 255.255.255.192
subnet mask
– Two subnets each with 64 IPv4 addresses will be:-
• 192.168.10.128/26
• 192.168.10.192/26
28
2/9/2020
VLSM
• Step 3
– Divide 192.168.10.192/26 Network again into two Networks, each with 32
IPv4 addresses using 255.255.255.224 subnet mask
– Two subnets each with 32 IPv4 addresses will be:-
• 192.168.10.192/27
• 192.168.10.224/27
VLSM
29
2/9/2020
SUPERNETTING
30
2/9/2020
SUPERNETTING
SUPERNETTING
• Example
– Network 1: 192.168.10.0
– Network 2: 192.168.11.0
31
2/9/2020
SUPERNETTING
SPECIAL ADDRESSES
32
2/9/2020
SPECIAL ADDRESSES
IP address 0.0.0.0
• In the IPV4, the address 0.0.0.0 is a non-routable meta-address
used to designate an invalid, unknown or non-applicable target.
• In the context of servers, 0.0.0.0 means "all IPv4 addresses on
the local machine". If a host has two IP addresses, 192.168.1.1
and 10.1.2.1, and a server running on the host listens on 0.0.0.0,
it will be reachable at both of those IPs.
• In the context of routing, 0.0.0.0 usually means the default route,
i.e. the route which leads to "the rest of" the internet instead of
somewhere on the local network.
33
2/9/2020
34
2/9/2020
IANA
5 x RIRs
35
2/9/2020
• Four of the five RIRs have exhausted allocation of all the blocks which they have
not reserved for IPv6 transition; this occurred on
• 15 April 2011 for the Asia-Pacific
• 14 September 2012 for Europe
• 10 June 2014 for Latin America and the Caribbean
• 24 September 2015 for North America.
36
2/9/2020
IPV6
• Why skip IPV5 ??? It was thought that a protocol ST-2 will become IPV5 but it
• IPV6 has 128 bits address…. every grain of sand on planet can have IP Address.
tunneling.
Lt Col Dr HASNAT KHURSHID
37