L06 NetworkLayer PartII
L06 NetworkLayer PartII
Chapter 06
Network Layer
(Part II)
1
Prepared by: Yee Jian Chew
Network Layer Technologies
NAT
2
Prepared by: Yee Jian Chew
NAT (Network Address Translation)
• A.k.a IP Masquerading
• IP address space (with many private IP
addresses) hidden under a single public IP
Address
3
NAT: network address translation
https://wikieducator.org/Aoraki_Digital_Technologies/Level_2/DT_2.50_AS91377/More_Advanced_Networking/Network_Address_Translation
6
NAT: network address translation
https://wikieducator.org/Aoraki_Digital_Technologies/Level_2/DT_2.50_AS91377/More_Advanced_Networking/Network_Address_Translation
7
NAT: network address translation
https://wikieducator.org/Aoraki_Digital_Technologies/Level_2/DT_2.50_AS91377/More_Advanced_Networking/Network_Address_Translation
8
NAT Motivation / Advantages
motivation: local network uses just one IP address
as far as outside world is concerned:
range of addresses not needed from ISP: just one IP
address for all devices
Made to save public IPv4 Addresses (2^32 = 4.3 Billion addresses)
Partial solution for the IPv4 address space exhaustion problem
• Enhanced Security
devices inside local net not explicitly addressable, visible by
outside world (a security plus)
can change addresses of devices in local network without
notifying outside world
can change ISP without changing addresses of devices in
local network 9
Public vs Private IP Address
17
Prepared by: Yee Jian Chew
Public vs Private IP address
also known as
Non-Routable
IP address in the
internet. 18
Classful IP Address
• In classful addressing, the address space is divided into five
classes: A, B, C, D, and E.
• IP addresses can be split into two sections:
• Network ID
• Used to identify network
• At the internet level, core routers only care about the network ID, use
network ID to sent to the appropriate gateway router
• Host ID
• Used to identify individual host/device
• E.g., University owns IP 11.0.0.0 ~ 11.255.255.255
• E.g., A device IP address = 11.3.2.2
• Network ID = 11 (first octet, 8 bit)
• Host ID = 3.2.2 (last three octet, 24bit)
• An example of class A address 19
Classful IP Address
• Destination IP = 11.3.2.2 (class A)
• Network ID = 11
• By looking at Network ID, Sender router will route to university router (gateway) via internet
(many core router)
• Host ID = 3.2.2
• By looking at Host ID, University router (gateway) will sent to the receiving host
• Gateway Router
• Serves as an entry or exit path to a certain network
Network
Many core routers 11.0.0.0~11.255.255.255
trying to reach
university router
network (11.0.0.0)
20
IPv4 Classful Address
multicast
Unassigned
(testing purpose)
Source: https://slideplayer.com/slide/12233447/ 21
Classful
In Practical,
Classful is obsolete, has been replaced
by CIDR (Classless Interdomain Routing)
large part of the addresses were wasted.
But, address class system is still in place
in many ways, important to understand
Source: https://slideplayer.com/slide/12233447/ 22
Classful vs Classless
Classful Classless
• Only pass the network • Pass both network
address, e.g., address and subnet
192.168.1.1 mask, e.g.,
• In classful addressing, 192.168.1.1,
the address space is 255.255.255.0
divided into five classes:
A, B, C, D, and E.
23
Subnet and Subnetting
24
Prepared by: Yee Jian Chew
Subnetting
• Process of taking a large network and splitting it
up into many individual smaller subnetworks
(or subnets)
• Incorrect subnetting setups are a common problem
you might run into as an IT Support specialist,
• it’s important to have a strong understanding of how
subnetting works
• Subnetting is done by changing the default subnet
mask by borrowing some of the bits from the
host portion
25
Subnetting (Given network 11.0.0.0)
Classful Classless (subnetting)
• Entire IP address range
(11.0.0.0 ~ 11.255.255.255) is
belong to the same network
• 16.7 Million IP address in a
single network
Network 11.0.0.0~11.255.255.255
26
Subnetting (Given network 11.0.0.0)
Classful Classless (subnetting)
• Entire IP address range • Divide large network into smaller
(11.0.0.0 ~ 11.255.255.255) is Entire University Network: 11.0.0.0/8
belong to the same network Subnet Mask = 255.0.0.0
IP Range = 11.0.0.0 ~ 11.255.255.255
• 16.7 Million IP address in a
Network 1 : 11.0.0.0/10 Network 2 : 11.64.0.0/10
single network Subnet Mask = 255.192.0.0 Subnet Mask = 255.192.0.0
IP Range = 11.0.0.0~11.63.255.255 IP Range = 11.64.0.0~11.127.255.255
• If the IP address is not used, it
will be wasted
Network 11.0.0.0~11.255.255.255
29
Subnet Mask - Explained
https://www.youtube.com/watch?v=s_Ntt6eTn94 30
CIDR (Classless Inter Domain Routing)
• Method to efficiently allocate IP addresses and
• enable IP routing
• Introduced by IETF (Internet Engineering Task
Force) in 1993
• Replaces former Classful IP addressing used in the
Internet
• Class A, B, C based subnet sizes were too large
• Many unused (wasted) IP addresses
• Makes the Internet more scalable, because
• networks can be assigned proper subnet sizes
35
CIDR (Classless Inter Domain Routing)
• CIDR is based on a concept called subnetting.
Subnetting allows you to take a class, or block
of IP addresses and further chop it up into
smaller blocks, or groups of IPs.
• CIDR and subnetting are virtually the same
thing. (both terms really refer to the same
concept.)
• Subnetting – used at organization level
• CIDR – generally used at the ISP level or
higher. Reference: https://www.itgeared.com/articles/1347-cidr-and-subnetting-tutorial/
36
IP addressing: CIDR / Subnetting
CIDR: Classless InterDomain Routing
• subnet portion of address of arbitrary length
• address format: a.b.c.d/x, where x is # bits in
subnet portion of address
192.168.1.0 / 24
Network host
40
IP addressing: CIDR / Subnetting
192.168.1.0 / 24
WHAT DOES THIS REALLY MEAN??
Network host
Network 192.168.1.0/24
Subnet Mask = 255.255.255.0
Network Address = 192.168.1.0
Before Subnetting Host IP = 192.168.1.1 ~ 192.168.1.254
Broadcast IP = 192.168.1.255
41
Before Subnetting
• IP = 192.168.1.0/24 Number of IP address
42
Before Subnetting
• IP = 192.168.1.0/24 Number of Host IP
address = 254
• Subnet Mask = 255.255.255.0 (192.168.1.1~254
43
Before Subnetting
• IP = 192.168.1.0 / 24
• Subnet Mask = 255.255.255.0
NETWORK ADDRESS
Number of available host address
BROADCAST ADDRESS
• IP = 192.168.1.0 / 26
• Subnet Mask = 255.255.255.192
• IP = 192.168.1.64 / 26
• Subnet Mask = 255.255.255.192
• IP = 192.168.1.128 / 26
• Subnet Mask = 255.255.255.192
• IP = 192.168.1.192 / 26
• Subnet Mask = 255.255.255.192
Source: https://www.youtube.com/watch?v=s_Ntt6eTn94
50
After Subnetting (change subnet mask)
Network 192.168.1.0/24
Subnet Mask = 255.255.255.0
Network Address = 192.168.1.0
Host IP = 192.168.1.0 ~ 192.168.1.254
Broadcast IP = 192.168.1.255
HOW?
Requirement:
3 Network
51
After Subnetting (change subnet mask)
Source: https://www.youtube.com/watch?v=s_Ntt6eTn94
52
IP addressing: CIDR / Subnetting
Given the ip address above, subnet the network with the following condition.
(i) Number of IP address required per subnet = 64
53
IP addressing: CIDR / Subnetting
Given the ip address above, subnet the network with the following condition.
(i) Number of IP address required per subnet = 64
Network host
54
IP addressing: CIDR / Subnetting
Given the ip address above, subnet the network with the following condition.
(i) Number of IP address required per subnet = 64
• Network 1: 192.168.1.0/26
• Network Address = 192.168.1.0
• Host IP = 192.168.1.1 ~ 192.168.1.62
• Broadcast IP = 192.168.1.63
• Number of available IP address = 64 (2^6)
• Number of host IP address = 62 (2^6 – 2)
55
IP addressing: CIDR / Subnetting
Given the ip address above, subnet the network with the following condition.
(i) Number of IP address required per subnet = 64
• Network 2: 192.168.1.64/26
• Network Address = 192.168.1.64
• Host IP = 192.168.1.65 ~ 192.168.1.126
• Broadcast IP = 192.168.1.127
• Number of available IP address = 64 (2^6)
• Number of host IP address = 62 (2^6 – 2)
56
IP addressing: CIDR / Subnetting
Given the ip address above, subnet the network with the following condition.
(i) Number of IP address required per subnet = 64
• Network 3: 192.168.1.128/26
• Network Address = 192.168.1.128
• Host IP = 192.168.1.128 ~ 192.168.1.190
• Broadcast IP = 192.168.1.191
• Number of available IP address = 64 (2^6)
• Number of host IP address = 62 (2^6 – 2)
57
IP addressing: CIDR / Subnetting
Given the ip address above, subnet the network with the following condition.
(i) Number of IP address required per subnet = 64
• Network 4: 192.168.1.192/26
• Network Address = 192.168.1.192
• Host IP = 192.168.1.193 ~ 192.168.1.254
• Broadcast IP = 192.168.1.255
• Number of available IP address = 64 (2^6)
• Number of host IP address = 62 (2^6 – 2)
58
After Subnetting (change subnet mask)
HOW?
77
Prepared by: Yee Jian Chew
Good Network
To the Internet
IP Address
Subnet Mask
Default Gateway
192.168.1.1
Switch
255.255.255.0
147.144.51.1
192.168.1.1
Switch
255.255.255.0
147.144.51.1
192.168.1.1
Switch
255.255.255.0
147.144.51.1
192.168.1.1
Switch
255.255.255.0
147.144.51.1
192.168.2.1
Switch
255.255.255.0
147.144.51.1
192.168.1.1
Switch
255.255.255.0
147.144.51.1
192.168.2.1
Switch
255.255.255.0
147.144.51.1
192.168.0.1
Switch
255.255.255.0
147.144.51.1
192.168.1.4
Switch
255.255.255.0
147.144.51.1
REFERENCES:
• Forouzan, A. Behrouz. Data communications & networking (sie). Tata McGraw-Hill Education, 2007.
• tcp ip model updated:
https://www.computernetworkingnotes.com/ccna-study-guide/similarities-and-differences-between-osi-and-tcp-i
p-model.html