0% found this document useful (0 votes)
2 views

Lesson 06

The document covers the Network Layer's functions, including packet transportation, routing, and addressing, emphasizing the importance of IP datagrams and their structure. It details different IP address classes (A, B, C, D, E), subnetting, and the use of subnet masks for network management. Additionally, it explains how IP addresses are allocated and aggregated by ISPs for efficient routing and communication.

Uploaded by

dreamy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lesson 06

The document covers the Network Layer's functions, including packet transportation, routing, and addressing, emphasizing the importance of IP datagrams and their structure. It details different IP address classes (A, B, C, D, E), subnetting, and the use of subnet masks for network management. Additionally, it explains how IP addresses are allocated and aggregated by ISPs for efficient routing and communication.

Uploaded by

dreamy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Lesson 06

Network Layer
&
Logical Addressing
Network Layer application
transport
network

• Transport packets from sender data link


physical

to receiver host. network


data link
network
data link
network

• Sending side compresses


physical physical
data link
physical network network

segments into datagrams. data link


physical
data link
physical

• Receiving side, delivers network


data link
network
data link

segments to transport layer. physical


network
data link
physical

physical
application
network transport
data link network network
network physical data link data link
data link physical physical
physical

2
Network Layer

Segments

3
Network Layer functions
• Primary function is to transport packets from source to
destination via multiple data link layer networks

• forwarding: move packets from router’s input to proper router output

• routing: determine route taken by packets from source to destination


• routing algorithms
values in arriving
packet header

0111 1

2
3

4
Network Layer functions
● What is the address of the destination?
● Globally unique address

● Which route is the best to get there?


● Determination of optimal path to be taken by the packets to

arrive at the destination

● How to differentially treat packets carrying different types of


payloads (voice, video, internet, mail etc.)

5
Network Layer functions
• Individual routing algorithm components in each and every router interact in
the control plane

Routing
Algorithm
control
plane

data
plane

0111 1
2
3

6
Network Layer

7
Network Layer:

Transport layer: TCP, UDP

Routing Addressing & packet handling


IP protocol
• Path selection • Addressing conventions
• RIP, BGP • Datagram format
Network
layer forwarding
Control
table
Border Gateway • Error reporting
Protocol (BGP) • Multicast signaling
• ICMP, IGMP
Routing
Information Data Link layer: Ethernet, WLAN, PPP
Protocol (RIP)
physical layer

8
IP Datagram
● Data transmitted over an internet using IP is carried in messages
called IP datagrams.
● Like all network protocol messages

• IP uses a specific format for its


datagrams.
• At IP version 4 (IPv4) datagram
format include 32 bits.
• The IPv4 datagram is conceptually
divided into two pieces:
The header
The payload

9
IP Datagram header format 32 bit

10
IP Address format

11000000 10101000 10000000 00000001


IPv4 Address is a 32-bit binary number

11000000 10101000 10000000 00000001


Split them into four octets (8-digit binary number)

192 168 128 1


Convert each octet into a decimal number

192 168 128 1


Separate the decimal numbers with DOTS
11
IP Address classes
● Originally entire IP address range was divided into classes

12
IP Address classes
● The first set of bits used to the network and the remaining
bits for the host into that network.

13
IP Address classes

14
IP Address class A

● The first 8 bits (called the first octet) used to the network and the
remaining have 24 bits for the host into that network.
● The first bit of the first octet is always set to 0 (zero)

● The network Address Range


00000000 – 01111111
0 - 127

15
IP Address class A
• Class A addresses only include IP starting from 0.0.0.0 to
127.255.255.255 only.
• The address 0.0.0.0 is a non-routable meta-address used to an
invalid or non-applicable.
• The IP range 127.255.255.255 is reserved for loopback IP addresses

• The usable network Address Range


00000001 – 01111110
1 - 126
0.0.0.1 to 126.255.255.255
16
IP Address class A
• Number of Hosts Per Network = 2^24 -2
• Network addresses = 2^7

An example of a Class A address is 102.168.212.226.

17
IP Address class B

● The first 16 bits used to the network and the remaining have 16 bits
for the host into that network.
● The first two bits of the first octet is always set to 1 and 0
● The network Address Range
10000000 – 10111111
128 - 191

18
IP Address class B
• Class B addresses only include IP starting from 128.0.0.0 to
191.255.255.255 only.
• 128.0.0.0 to 191.255.255.255
• Number of Hosts Per Network = 2^16 -2 = 65534
• Network addresses = 2^14 = 16384

An example of a Class B address is 132.168.212.226.

Network addresses
Host addresses

19
IP Address class C

● The first 24 bits used to the network and the remaining have 8 bits
for the host into that network.
● The first three bits of the first octet is always set to 110
● The network Address Range
11000000 – 11011111
192 - 223

20
IP Address class C
• Class C addresses only include IP starting from 192.0.0.0 to
223.255.255.255 only.
• 192.0.0.0 to 223.255.255.255
• Number of Hosts Per Network = 2^8 -2 = 254
• Network addresses = 2^21 = 2097152

An example of a Class C address is 193.168.212.226.

Network addresses
Host addresses
21
IP Address class D

● The first four bits of the first octet is always set to 1110
● The network Address Range
11100000 – 11101111
224 - 239

22
IP Address class D
• Class D addresses only include IP starting from 224.0.0.0 to
239.255.255.255
• Class D is reserved for Multicasting.
• Multicast is a method of group communication where the sender
sends data to multiple receivers or nodes present in the network
simultaneously.
• An example of a Class B address is 233.168.212.226.

Network addresses

Ex: IPTV

23
IP Address class E

● The first four bits of the first octet is always set to 1111
● The network Address Range
11110000 – 11111111
240 - 255

24
IP Address class E
• Class E addresses only include IP starting from 240.0.0.0 to
255.255.255.255
• This IP Class is used for experimental purposes only for Study.

An example of a Class B address is 245.168.212.226.

Network addresses

25
Classless Addressing

● Host ID and Network ID can be separated at any bit boundary –


Identify the boundary using Subnet Mask

● Notation to identify a network


• <Network ID>/<Number of bits in Subnet ID>
• E.g. 192.168.128.0/24
• The first 24 bits of the address as networks and the remaining bit as the host
address.

26
What is a Subnet?
● Network ID, also known as Network Prefix, in classful addressing
extended by adding bits from Host ID to form an random Network ID
called Subnet ID
● Subnet ID <-> Extended Network Prefix
● Can have multiple levels of addressing within an assigned classfull address block
● Better control and manageable over addresses.

Ex: Class C address


Network ID (Classfull) Host ID

11000000 10101000 10000000 00000001 192.168.128.1

Subnet ID (Classless) Host ID

● Sending a packet from one subnet to another requires routing


27
Subnetting: example

● Let’s split 192.168.128.0 network into two subnets

11000000 10101000 10000000 00000000 Address block


(192.168.128.0 - 192.168.128.255)
11000000 10101000 10000000 11111111

Subnet 11000000 10101000 10000000 00000000


192.168.128.0/25
#1: 11000000 10101000 10000000 01111111 (192.168.128.0 – 192.168.128.127)

11000000 10101000 10000000 10000000


Subnet 192.168.128.128/25
#2: 11000000 10101000 10000000 11111111 (192.168.128.128 – 192.168.128.255)

Subnet ID: 25 bits


28
Subnetting: Subnet mask

● Let’s split 192.168.128.0 network into two subnets

11000000 10101000 10000000 00000000 Subnet mask = 255.255.255. xxx


xxx = 255 – no of host
11000000 10101000 10000000 11111111 255-127
128

Subnet 11000000 10101000 10000000 00000000


Subnet mask = 255.255.255.128
#1: 11000000 10101000 10000000 01111111

11000000 10101000 10000000 10000000


Subnet
#2: 11000000 10101000 10000000 11111111

Subnet ID: 25 bits


29
Subnetting: four (4) subnets example
4 → 00 ,01, 10,11 Host part 000000 -111111

11000000 10101000 10000000 00000000


Address block
11000000 10101000 10000000 11111111
(192.168.128.0 - 192.168.128.255)

11000000 10101000 10000000 00000000


Subnet #1: 192.168.128.0/26
11000000 10101000 10000000 00111111 (192.128.128.0 – 192.168.128.63)

11000000 10101000 10000000 01000000 Subnet #2: 192.168.128.64/26


11000000 10101000 10000000 01111111 (192.128.128.64 – 192.168.128.127)

11000000 10101000 10000000 10000000 Subnet #3: 192.168.128.128/26


11000000 10101000 10000000 10111111 (192.128.128.128 – 192.168.128.191)

11000000 10101000 10000000 11000000


Subnet #3: 192.168.128.192/26
11111111 (192.128.128.192 – 192.168.128.255)
11000000 10101000 10000000

Subnet ID: 26 bits 30


Subnet Mask:
A subnet mask is a 32-bit number created by setting host bits
to all 0s and setting network bits to all 1s.

Class A, B, and C networks have natural masks, or default


subnet masks:
Class A: 255.0.0.0
Class B: 255.255.0.0
Class C: 255.255.255.0

An example of Class A IP address and subnet mask would be the Class A


default subnetmask of 255.0.0.0 and an IP address of 10.20.12.2

31
Routing and subnets

Routing table

Interface #2 Destination Subnet Forward to


192.168.128.129/ Interface
Incoming packet
Interface #1 26
Destination IP: 192.168.128.72
Source IP: 10.1.1.14 IP 10.1.1.1/24 192.168.128.64/26 Interface #3

192.168.128.72 Interface #3 192.168.128.128/26 Interface #2


Destination IP: 192.168.128.65/2
11000000 10101000 10000000 01001000 6 10.1.1.0/24 Interface #1
AND

Subnet Mask: 11111111 11111111 11111111 11000000

Destination 11000000 10101000 10000000 01000000


Subnet ID:
Match the subnet ID derived above with the
routing table entries

32
How do we get an IP address?
● Host: IP address
● IP Address is configured on a network interface
● Static: Manually configured / Dynamic: From a DHCP Server

● Network: Subnet part of the IP address


● ISP (Internet service provider) allocates a portion from his address space

ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20

Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23


Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23
Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23
... ….. …. ….
Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23

33
IP Address Aggregation
Organization 0
200.23.16.0/23
Organization 1 “Send me anything
200.23.18.0/23 with addresses
beginning
Organization 2
200.23.16.0/20”
200.23.20.0/23 . ISP #1
.
. . Internet
.
Organization 7 .
200.23.30.0/23
“Send me anything
ISP #2 with addresses
beginning
199.31.0.0/16”

● ISP gets an IP address block from (Internet Corporation for Assigned


Names and Numbers) ICANN and distribute it to its
customers as block of addresses.
34
Special IP addresses: Private IP’s

● Public: IP Addresses that are used in the Internet


● Should be globally unique
● Private: Specific IP Address ranges dedicated to be used internally within
an organization
● Can overlap across organizations
● Non-routable in the Internet, i.e. cannot be used to directly connect to the
Internet

Class From To Subnet bits Subnet Mask

Class "A" or 24 Bit 10.0.0.0 10.255.255.255 /8 255.0.0.0

Class "B" or 20 Bit 172.16.0.0 172.31.255.255 /16 255.255.0.0

Class "C" or 16 Bit 192.168.0.0 192.168.255.255 /24 255.255.255.0

35
Use of Private IP addresses

● Private IP addresses are non-routable in the Internet,


hence cannot be used as the source IP to directly access
over Internet.
● Use one Public IP address facing the Internet
● How can one public address represent many private
addresses?
● Use Layer 4 Port address in addition to IP
● TCP Port: A way to identify application layer protocols

● E.g. SMTP: 25, FTP: 20,21, Telnet: 23 etc.

● Each private IP address will map to <public IP><Port #>


combination ex: 192.168.32.10:25
36
Thanks!

You might also like