Professional Documents
Culture Documents
Fall Semester
Lec_12
Outlines
▪ Module 01: Computer Networks and the Internet
▪ Module 05: The Link Layer: Links, Access Networks, and LANs
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
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 available in class A = Numbers possible due to remaining available 31 bits = 231
Total number of IP Addresses available in class B = Numbers possible due to remaining available 30 bits = 230
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 available in class C = Numbers possible due to remaining available 29 bits = 229
14
Subnetting
15
Subnetting
16
Subnetting
17
Types of Subnetting
Subnetting of a network may be carried out in the following two ways
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