Lecture 6 Logical Addressing
Lecture 6 Logical Addressing
IP Address
• An Internet address or IP address
uniquely identifies a device connected to
the Internet at the network layer
• IP = Internet Protocol
• IP is the base protocol at network layer
in the Internet model or the TCP/IP
protocol suit
IPv4 Address
• An IPv4 address is a 32-bit address
• The address space of IPv4 is 232 or
4,294,967,296.
• Represented in 4 blocks of 1 byte each
Example:
Convert the following IPv4 address from binary to
dotted decimal
Answer:
c) 203.51. 153.235
d) 180.149.170.85
Classful Addressing
A
B Unicast communication
C
D Multicast communication
E Reserved for special use
Network ID and Host ID
Mask
• Although the length of the netid and
hostid (in bits) is predetermined in
classful addressing, we can also use a
mask
• The mask can help us to find the netid
and the hostid
Finding the Class in binary notation
Finding the class in dotted-decimal notation
Network and Broadcast Address
• If all host bits are set to 0, it’s called a Network address
If all host bits are set to 1, it’s called a Broadcast address
Number of
Hosts = 2n- 2
192.168.1.254
192.168.1.255 Broadcast Address
Subnetwork
• Division of a large network in to smaller groups
is called Subnetting
• Each group is referred to as a Subnet
Example 1
Consider a class C network
IP Address: 192.168.1.0
Mask: 255.255.255.0
11111111 . 11111111 . 11111111 . 00000000
Take the first bit from the host portion (Fourth Octet) to create a subnet
Fourth Octet becomes 10000000
New subnet mask = 255.255.255.128
Number of subnets = 2n = 21 = 2
Block Size = 256 – 128= 128
Number of valid hosts per subnet = 27 – 2 = 126
Subnet1 Subnet2
192.168.1.0 Network address 192.168.1.128 Network address
192.168.1.1 --- 192.168.1.126 192.168.1.129 --- 192.168.1.254
192.168.1.127 Broadcast Address 192.168.1.255 Broadcast address
Classless Addressing (VLSM)
• Problem with classful addresses
wastage due to fixed blocks of addresses
• Solution: Classless addressing
Variable length address blocks
No classes
CIDR = Classless Inter-Domain Routing
• Classful addressing is almost obsolete and
replaced with classless addressing.
Example:
A block of addresses is granted to a small organization. We know that one of the
addresses is 205.16.37.39/28.
a) What is the first valid host address in the block
b) What is the Network and broadcast address of the subnet
Solution:
Subnet 1: 2 hosts
Subnet 2 : 30 hosts
Subnet 3: 64 hosts
Solution:
Subnet 1
192.168.1.0 /30
Subnet 2
192.168.1.0 /27
Subnet 3
192.168.1.0 /26
Private Addresses
• Private IP addresses are used to assign
computers within the private space without
letting them directly expose to the Internet
• Private IP addresses are non-routable
Public/Global IP Address
• A public IP address is an IP address that can be
accessed over the Internet. It’s a routable
address
Dynamic NAT
… … … … … …
Common Ports
80 HTTP
443 HTTPS
20 & 21 FTP
23 Telnet
22 SSH
25 SMTP
IPv6 Addresses
IPv6 address structure
• An IPv6 address is 128 bits long
• It is usually presented in hexadecimal
colon notation