SWE-306
Computer Communication &
Networks (CC&N)
Internet Layer
Logical Addressing
(Week 7 Lecture)
1
Internet Layer Functions
• Internet Layer accepts all content from the Transport Layer as Data
• Responsible for adding header containing the source and destination IP
addresses
• Responsible for making Routing Decisions to decide the best route
• For a smooth transition to IPv6 which commenced in 2012, all new
hardware most be dual protocol stack enabled called IPv4/v6
Links
• The physical and data link layers deliver data
within a network.
3
Network Layer
• Network layer is responsible for host-to-host
delivery of data across networks
4
Network layer addressing
• 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
5
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
6
Converting binary to decimal
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
1 0 1 1 0 0 0 0
Answer = 176
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
1 1 1 1 1 1 1 1
Answer = 255
7
8
Example
Change the following IPv4 addresses from binary
notation to dotted-decimal notation.
Solution
We replace each group of 8 bits with its equivalent
decimal number and add dots for separation.
9
Converting
decimal to binary
10
Converting decimal to binary
[Link]
192 168 10 10
11000000 10101000 00001010 00001010
11000000 10101000 00001010 00001010
11
Example
Change the following IPv4 addresses from dotted-
decimal notation to binary notation.
Solution
We replace each decimal number with its binary
equivalent.
12
Classful Addressing
In classful addressing, the address space is
divided into five classes:
• A
• B Unicast communication
• C
• D Multicast communication
• E Reserved for special use
13
Finding the class in binary notation
14
Finding the class in dotted-decimal
notation
15
Network ID and Host ID
16
Network Address
• Network address is an • A network address is different
address that defines the from a netid. A network address
network itself; it cannot be has both netid and hostid, with
assigned to a host. 0s for the hostid.
17
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
18
Subnet Masks
19
Example
A block of addresses is granted to a small
organization. We know that one of the
addresses is [Link]/24.
Find…
a. The first address
b. The last address
c. The number of addresses.
20
Sample Internet
21
Subnetwork
• Q. What if an organisation wants to
– arrange its hosts into groups?
– break its large network into smaller networks?
• A. Divide its network into smaller
subnetworks or subnets.
22
Subnets and Subnet Masks
• host portion of address partitioned into subnet
number and host number
• local routers route within subnetted network
• subnet mask indicates which bits are subnet
number and which are host number
23
Subnet Masks
• Routers outside a subnetted organisation
use default masks
• Routers inside the organisation use subnet
masks
24
Subnetworks
25
Subnetting
• Two considerations when planning subnets:
– Subnetting based on number of subnets required
• No. of subnets = 2n, where n is the no. of bits borrowed
for subnets
– Subnetting based on number of host addresses
required
• No. of hosts in a subnet = 2n-2, where n is the no. of
host bits
26
Example: Creating 4 Subnets
Borrowing 2 bits to create 4 subnets. 22 = 4 subnets
Creating 4 Subnets:
27
Example: Creating 8 Subnets
Borrowing 3 bits to Create 8 Subnets. 23 = 8 subnets
.
.
.
28
Example: 8 Subnets (cont.)
29
Address wastage in equal sized
subnets
Equal Sized Subnets
• Using traditional
subnetting, same number
of addresses is allocated for 30 hosts 30 hosts
each subnet.
• Subnets that require fewer 30 hosts 30 hosts
addresses have unused
(wasted) addresses 30 hosts
30 hosts
– for example, WAN links only
need two addresses.
30 hosts 30 hosts
30