You are on page 1of 34

2022-2023

Fall Semester

Computer Networks (1) – L3


Computer Networks Technology – L2
Dr. Ahmed Abdelreheem

Lec_12
Outlines
▪ Module 01: Computer Networks and the Internet

▪ Module 02: Application Layer

▪ Module 03: Transport Layer

▪ Module 04: The Network Layer

▪ Module 05: The Link Layer: Links, Access Networks, and LANs

▪ Module 06: The physical layer

2
IP Datagram format
32 bits
IP protocol version number total datagram
ver head. type of length length (bytes)
header length(bytes) len service
fragment fragmentation/
“type” of service: 16-bit identifier flgs
▪ diffserv (0:5) offset reassembly
time to upper header
▪ ECN (6:7) header checksum
live layer checksum
TTL: remaining max hops source IP address 32-bit source IP address
(decremented at each router)
Maximum length: 64K bytes
destination IP address 32-bit destination IP address
upper layer protocol (e.g., TCP or UDP) Typically: 1500 bytes or less
options (if any) e.g., timestamp, record
overhead route taken
▪ 20 bytes of TCP payload data
▪ 20 bytes of IP (variable length,
▪ = 40 bytes + app typically a TCP
layer overhead for or UDP segment)
3 TCP+IP
Network Layer: 4-3
IP addressing: introduction
223.1.1.1

• IP address: 32-bit identifier 223.1.2.1


associated with each host or router 223.1.1.2
interface 223.1.1.4 223.1.2.9

• interface: connection between 223.1.1.3


223.1.3.27

host/router and physical link 223.1.2.2

• router’s typically have multiple


interfaces 223.1.3.1 223.1.3.2

• host typically has one or two


interfaces (e.g., wired Ethernet,
wireless 802.11) dotted-decimal IP address notation:
223.1.1.1 = 11011111 00000001 00000001 00000001

4 223 1 1 1
IP addressing

5
IP addressing
mobile network
national or global ISP

datacenter
network

enterprise
network

6
7
Classful Addressing
In Classful Addressing System, IP Addresses are organized into following 5 classes

8
9
1. Class A- If the 32 bit binary address starts with a bit 0, then IP Address belongs to class A. In class A IP Address,
• The first 8 bits are used for the Network ID.
• The remaining 24 bits are used for the Host ID.

Total Number Of IP Addresses:

Total number of IP Addresses available in class A = Numbers possible due to remaining available 31 bits = 231

Total Number Of Networks:


Total number of networks available in class A = Numbers possible due to remaining available 7 bits in the Net ID – 2
= 27 – 2 = 126

Total Number Of Hosts:


Total number of hosts that can be configured in class A = Numbers possible due to available 24 bits in the Host ID – 2
= 224 – 2
Range Of 1st Octet- We have:
• Minimum value of 1st octet = 00000000 = 0
• Maximum value of 1st octet = 01111111 = 127
• Range of 1st octet = [0, 127]
• But 2 networks are reserved and unused. So, Range of 1st octet = [1, 126]
Use- Class A is used by organizations requiring very large size networks like
10 NASA, Pentagon etc.
1. Class B- If the 32 bit binary address starts with a bit 10, then IP Address belongs to class B.
• The first 16 bits are used for the Network ID.
• The remaining 16 bits are used for the Host ID.

Total Number Of IP Addresses:

Total number of IP Addresses available in class B = Numbers possible due to remaining available 30 bits = 230

Total Number Of Networks:


Total number of networks available in class B = Numbers possible due to remaining available 14 bits in the Net ID = 214

Total Number Of Hosts:


number of hosts that can be configured in class B = Numbers possible due to available 16 bits in the Host ID – 2 = 216 – 2
Range Of 1st Octet- We have:
• Minimum value of 1st octet = 10000000 = 128
• Maximum value of 1st octet = 10111111 = 191
• Range of 1st octet = [128, 191]
Use- Class B is used by organizations requiring medium size networks like IRCTC, banks etc.

11
1. Class C- If the 32 bit binary address starts with a bit 110, then IP Address belongs to class C.
• The first 24 bits are used for the Network ID.
• The remaining 8 bits are used for the Host ID.

Total Number Of IP Addresses:

Total number of IP Addresses available in class C = Numbers possible due to remaining available 29 bits = 229

Total Number Of Networks:


Total number of networks available in class C = Numbers possible due to remaining available 21 bits in the Net ID = 221

Total Number Of Hosts:


number of hosts that can be configured in class C = Numbers possible due to available 16 bits in the Host ID – 2 = 28 – 2
Range Of 1st Octet- We have:
• Minimum value of 1st octet = 11000000 = 192
• Maximum value of 1st octet = 110111111 = 223
• Range of 1st octet = [192, 223]
• Use-Class C is used by organizations requiring small to medium size networks.
• For example- engineering colleges, small universities, small offices etc
12
13
Subnetting

14
Subnetting

15
Subnetting

16
Subnetting

17
Types of Subnetting
Subnetting of a network may be carried out in the following two ways

1. Fixed Length Subnetting- Fixed length subnetting also called as classful


subnetting divides the network into subnets where-
• All the subnets are of same size.
• All the subnets have equal number of hosts.
• All the subnets have same subnet mask.

2. Variable Length Subnetting- Variable length subnetting also called as classless subnetting divides the network
into subnets where:
• All the subnets are not of same size.
• All the subnets do not have equal number of hosts.
• All the subnets do not have same subnet mask.

Disadvantages of Subnetting-
1. Subnetting leads to loss of IP Addresses.
During subnetting,
• We have to face a loss of IP Addresses.
• This is because two IP Addresses are wasted for each subnet.
• One IP address is wasted for its network address.
• Other IP Address is wasted for its direct broadcasting address.
18
Classful IP Addresses (Until 1993)

19
The old way: Internet Address Classes

20
Problems with Classful IP Addresses

21
IP addressing: CIDR
CIDR: Classless InterDomain Routing (pronounced “cider”)
• subnet portion of address of arbitrary length
• address format: a.b.c.d/x, where x is # bits in subnet portion
of address
subnet host
part part
11001000 00010111 00010000 00000000
200.23.16.0/23

22
Network Layer: 4-22
CIDR address blocks

23
CIDR address blocks

24
Subnetting Class B address example

25
26
27
28
Class A Subnets

29
Class B Subnets

30
Class C Subnets

31
IP Subnetting Examples: Example 1
192.168.5.85 /24 Address.
Let’s determine the network and host part of this address determine the network and host
part of this address.

192.168.5.0.

For this example, our broadcast address will be 192.168.5.255. AS you can
see, all the host bits are full of 1s for broadcast address. The other addresses in
32 the middle through 192.168.5.1 to 192.168.5.254 are host addresses
IP Subnetting Examples: Example 2
10.128.240.50/30
Let’s determine the network and host part of this address determine the network and host
part of this address.

00001010.10000000.11110000.00110000 10.128.240.48
Here, the last two bits are host bits and the other bits are network bits. When we set all the host bits
with 1s, we will find the Broadcast Address. This is 00001010.10000000.11110000.00110011 in
binary. The decimal value is 10.128.240.51.

33

You might also like