Chap 5 Reference Model
Chap 5 Reference Model
Chap 5 Reference Model
• An IPv4 address is a 32-bit address used to uniquely identify a host or a router on the Internet.
• IP addresses are globally managed by Internet Assigned Numbers Authority(IANA).
• Address Space:
• An address space is the total number of addresses used by the protocol.
• IPv4 uses 32-bit addresses, which means that the address space is 232 or 4,294,967,296 (more than four
billion)
• Notations:
IPv4 Addressing :Address Space
• Hierarchy in Addressing:
• A 32-bit IPv4 address is divided into two parts.:
• The first part of the address, called the prefix, defines the network;
• the second part of the address, called the suffix, defines the host(node)
• In classful addressing address space is divided into five classes :class A, B, C, D, and E
• In class A, one byte defines the netid (prefix) and three bytes define the hostid (suffix).
• In class B, two bytes define the netid and two bytes define the hostid.
• In class C, three bytes define the netid and one byte defines the hostid.
IPv4 Addressing:Classful Addressing
• The IPv4 address is divided into two parts:
• Network ID
• Host ID
• Classful Addressing
• In classful addressing address space is divided into five classes :class A, B, C, D and E
• Classes A, B, and C are used by the majority of devices on the Internet
• Classes D and E are reserved for multicast and experimental purposes respectively.
• Each of these classes has a valid range of IP addresses.
IPv4 Addressing:Classful Addressing
• Class A :
• IP addresses belonging to class A are assigned to the networks that contain a large number of hosts.
• The network ID is 8 bits long.
• The host ID is 24 bits long.
• The first bit of the first octet in class A is always set to 0. The remaining 7 bits in the first octet are used to determine
network ID. The 24 bits of host ID are used to determine the host in any network
• IP addresses belonging to class A ranges from 0.0.0.0 – 127.255.255.255.
IPv4 Addressing:Classful Addressing
• Class B
• IP address belonging to class B is assigned to networks that range from medium-sized to large-sized
networks.
• The network ID is 16 bits long.
• The host ID is 16 bits long.
• The higher-order bits of the first octet of IP addresses of class B are always set to 10.
• The remaining 14 bits are used to determine the network ID and the 16 bits of host ID are used to
determine the host in a network.
• IP addresses belonging to class B ranges from 128.0.0.0 – 191.255.255.255.
IPv4 Addressing:Classful Addressing
• Class C
• IP addresses belonging to class C are assigned to small-sized networks.
• The network ID is 24 bits long.
• The host ID is 8 bits long.
• The higher-order bits of the first octet of IP addresses of class C is always set to 110.
• The remaining 21 bits are used to determine the network ID.
• The 8 bits of host ID are used to determine the host in any network.
• IP addresses belonging to class C range from 192.0.0.0 – 223.255.255.255.
IPv4 Addressing:Classful Addressing
• Class D
• IP address belonging to class D is reserved for multi-casting.
• The higher-order bits of the first octet of IP addresses belonging to class D is always set to 1110.
• IP addresses belonging to class D range from 224.0.0.0 – 239.255.255.255.
• Class E
• IP addresses belonging to class E are reserved for experimental and research purposes.
• The higher-order bits of the first octet of class E are always set to 1111.
• IP addresses of class E range from 240.0.0.0 – 255.255.255.255
IPv4 Addressing:Classful Addressing
• In classful addressing each class is divided into a fixed number of blocks with each block having a fixed
size as shown in Table.
Actual
No. of Blocks or
Network Network Host Block Size or Range of IP Address in
Class Leading Bits Max. number Application
Identifier Bits Identifier Identifier Bits Max. number of hosts Dotted decimal notations
of Networks
Bits
0.0.0.0 to Unicast(Large
A 0 8 7 27=128 24 224=1,67,77,216
127.255.255.255 organizations)
128.0.0.0 to Unicast(Midsize
B 10 16 14 214=16,384 16 216=65,536
191.255.255.255 organizations)
192.0.0.0 to Unicast(Small
C 110 24 21 221=20,97,152 8 28=256
223.255.255.255 organizations)
224.0.0.0 to
D 1110 - - - - - Multicasting
239.255.255.255
240.0.0.0 to Reserved for future
E 1111 - - - - -
255.255.255.255 use
IPv4 Addressing:Classful Addressing
• Problems with Classful Addressing
• The problem with this classful addressing method is that millions of class A addresses are wasted,
• Thousands of the class B addresses are wasted, whereas,
• The number of addresses available in class C is so small that it cannot satisfy the needs of organizations.
• Class D addresses are used for multicast routing and are therefore available as a single block only.
• Class E addresses are reserved.
• Because of these problems, Classful addressing was replaced by Classless Inter-Domain Routing (CIDR) in
1993.
IPv4 Addressing:Classful Addressing:
• Subnet Mask:
• The purpose of subnet mask is to identify which part of an IP address is network part and which part is host
part.
• Subnet mask is a 32 bit number created by setting network bits to all 1s and setting host bits to all 0s.
• The last column of Table shows the mask in the form /n where n can be 8, 16, or 24 in classful addressing.
• This notation is also called slash notation or Classless Interdomain Routing (CIDR) notation.
IPv4 Addressing:Classful Addressing:
Example: Find the error, if any, in the following IPv4 addresses.
Solution:
a. There must be no leading zero (045).
b. There can be no more than four bytes in IP address.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal
notation is not allowed.
19.12
IPv4 Addressing:Classful Addressing:
Solution:
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
19.13
IPv4 Addressing:Classful Addressing
• Types of Subnetting:
• Fixed Length Subnetting:
• Fixed length subnetting (classful subnetting) divides network into subnets such that:
o All the subnet are of same size
o All the subnet have equal number of hosts
o All the subnet have same subnet mask
Fig.A Supernetwork
Supernetting
• Example: Suppose we have four small networks with network ID as
• 201.1.0.0,
• 201.1.1.0,
• 201.1.2.0,
• 201.1.3.0.
• These four networks can be combined to form a supernet.
• The supernet ID for all the four networks will be 201.1.0.0
• Supernet Mask
• Supernet Mask is a 32-bit number where all the fixed bits of the network are represented by 1 and the variable part is
represented by 0.
Supernetting
• For Example:
• Consider four small networks:
192.128.197.0/24,
192.128.198.0/24,
192.128.199.0/24,
192.128.200.0/24,
and we want to combine these four networks into one supernet.
192.128.11000101.0/24
192.128.11000110.0/24
192.128.11000111.0/24
192.128.11001000.0/24
192.128.11000000.0
192.128.192.0/20
Supernetting
• Supernetting combines multiple small networks into one larger network.
• There are three rules for Supernetting:
• Contiguous : All the networks should be contiguous.
• Same size: All the networks should be of the same size and also a power of 2 i.e. 2^n.
• Divisibility: The first network ID should be divisible by the size of the block.
• For Example: Consider two networks:192.168.0.0/24 and 192.168.1.0/24 and we want to combine these two
networks into one supernet.
• These two networks are the same all the way up to the 23rd bit (counting from the left side). The 24th bit is
where the difference is (highlighted in orange). Therefore, the subnet mask of the new supernet will be 1 all
the way up to the 23rd bit and then 0 from there:
• Therefore, the supernet is (192.168.0.0) with the new subnet mask as: 192.168.0.0/23.
Supernetting
• For Example:
• Consider four networks:
• 10.4.0.0/16,
• 10.5.0.0/16,
• 10.6.0.0/16,
• 10.7.0.0/16.
• These networks are the same up to the 14th bit. Therefore, the supernet is 10.4.0.0/14
IPv4 Addressing : Classless addressing
• In Classless addressing, the whole address space is divided into variable length blocks.
• The prefix in an address defines the block (network); the suffix defines the node (hosts).
• We can have a block of 1 address, 2 addresses, 4 addresses, 8 addresses, and so on.
• Restrictions on classless address blocks:
1. The addresses in block must contiguous , one after another.
2. The number of addresses in a block needs to be a power of 2.
3. The first address must be evenly divisible by the number of addresses.
IPv4 Addressing : Classless addressing
• Prefix Length: Slash Notation
• In classless addressing prefix length is variable.
• We can have a prefix length that ranges from 0 to 32.
• In classless address, the prefix length, n, is added to the address, separated by a slash.
• The notation is informally referred to as slash notation and formally as classless interdomain routing or
CIDR (pronounced cider) strategy
• An address in classless addressing can be represented as shown in Figure 18.20.
IPv4 Addressing: Classless addressing
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010000
or
205.16.37.32.
19.33
IPv4 Addressing: Classless addressing
19.34
IPv4 Addressing: Classless addressing
Solution: The number of addresses in the block can be found by using the
formula 232−n
The value of n is 28, which means that number of addresses are= 2 32−28
=24
= 16
19.35
Example 19.9
Another way to find the first address, the last address, and the number of
addresses is to represent the mask as a 32-bit binary number.
In Example 205.16.37.39/28
the /28 can be represented as
11111111 11111111 11111111 11110000
(twenty-eight 1s and four 0s).
Find
a. The first address
b. The last address
19.36
Example 19.9 (continued)
Solution
a. The first address can be found by ANDing the given
addresses with the mask. ANDing here is done bit by
bit. The result of ANDing 2 bits is 1 if both bits are 1s;
the result is 0 otherwise.
19.37
Example 19.9 (continued)
19.38
IPv4 Addressing
Classful Addressing Classless Addressing
In classful addressing address space is divided into five In classless addressing, the whole address space is
classes :class A, B, C, D, and E, each class is divided into a divided into variable length blocks.
fixed length blocks
it allocates IP addresses according to five major classes such Its IP address allocation method designed to replace
as Class A,B,C,D,E the classful addressing
It uses fixed length prefix it uses variable length prefix
It uses fixed length subnet mask it uses variable length subnet mask
Its less effective method of allocating IP addresses Its more effective method of allocating IP addresses
Its less practical. Its more practical.
It does not support Classless Inter-Domain Routing (CIDR). It supports Classless Inter-Domain Routing (CIDR).
It requires more bandwidth . As a result, it becomes slower It requires less bandwidth. Thus, fast and less
and more expensive as compared to classless addressing. expensive as compared to classful addressing.
IPv4 Addressing
IPv6 Addressing: Representation
• The main reason for migration from IPv4 to IPv6 is the small size of the address space in IPv4.
• An IPv6 address is 128 bits or 16 bytes (octets) long, four times the address length in IPv4.
• Representation:
• There are several notations to represent IPv6 addresses.
• The following figure shows two of these notations: binary and colon hexadecimal.
• CIDR Notation:
• IPv6 uses hierarchical addressing. we can define a prefix length using CIDR notation .
• For example, we can define a prefix of 60 bits using CIDR as shown below:
• FDEC::BBFF:0:FFFF/60
IPv6 Addressing: Representation
• Show colon hex notation for IPv6 addresses:
A) An address with 64 0’s followed by 64 1’s
0000:0000:0000:0000:FFFF:FFFF:FFFF:FFFF
B) 2001:0000:0000:0012:0000:0000:1234:56AB
2001::12:0:0:1234:56AB
C) 0000:0000:FFFF:0000:0000:0000:0000:0000
0:0:FFFF::
IPv6 Addressing: Representation
Solution
We first need to align the left side of the double colon to the left of the
original pattern and the right side of the double colon to the right of the
original pattern to find how many 0s we need to replace the double colon.
19.46
IPv6 Addressing: Address Space
• The address space of IPv6 consists 2128 addresses.
• The size of the address space is :
• 340, 282, 366, 920, 938, 463, 374, 607, 431, 768, 211, 456.
• This address space is 296 times more than IPv4 address-definitely there no address depletion.
• we assume that only 1/64 (i.e. almost 2 percent) of the addresses in the address space can be assigned to the people on
planet Earth and the rest are reserved for special purposes.
• Three Address Types :In IPv6, a destination address can belong to one of three categories:
• Unicast address : Unicast address used to defines a single computer.
• The packet sent to a unicast address must be delivered to specific computer.
• Anycast address : Anycast address defines a group of computers that all share a single address.
• A packet send to a anycast address is delivered to only one member of the group, the most reachable one.
• Multicast addresses :Multicast address also defines a group of computers.
• A packet send to a multicast address is delivered to each member of the group.
Difference between IPv4 and IPv6 Protocol
IPv4 IPv6
IPv4 addresses are 32 bits length. IPv6 addresses are 128 bits length.
IPv4 address space is 232 (i.e. 4.3 billion addresses) IPv6 address space is 2128
(i.e. 340 trillion trillion trillion addresses)
IPv4 addresses are represented in dotted decimal notation. IPv6 addresses are represented in colon hexadecimal notation
Manual (Static) or DHCP (Dynamic) is required to configure IPv4 addresses. Auto-configuration of addresses is available.
Address Resolution Protocol (ARP) is available to map IPv4 addresses to Address Resolution Protocol (ARP) is replaced with a function of
MAC addresses. Neighbor Discovery Protocol (NDP).
Internet Group Management Protocol (IGMP) is used to manage multicast
IGMP is replaced with Multicast Listener Discovery (MLD) messages.
group membership.
• Request: The client evaluates the Offer and sends a DHCP Request
message to the server, indicating its acceptance of the proposed IP
address and other TCP/IP configuration parameters.
• Dynamic allocation-
• DHCP server assigns a temporary IP address to client from a pool of addresses.
• In dynamic allocation , IP address are allocated for a limited period of time known as lease.
• if client wants to continue to use the IP address then lease must be renewed .
• Automatic allocation-
• The DHCP server automatically assigns a permanent IP address to a client from pool of addresses.
• No lease expiration time applied to automatic allocation.
DHCP message format
• DHCP Message Format :DHCP is a client-server protocol in which the client sends a request message and the server
returns a response message
Advantages of DHCP
• Centralized management of IP addresses and TCP/IP configuration-
• If DHCP server configured properly, then it will automatically assign IP address and TCP/IP configuration
parameters to every computer in a network.
• No duplicate IP addresses-
• If the entire process of configuration of DHCP is done properly ,then there will be no a problem of a
duplicate IP address.
Network Layer Services
• Connection-Oriented Vs Connectionless Network Service
• Delivery of a packet can be accomplished by using either a connection-oriented or a connectionless network service.
• In a connection-oriented service, the source first makes a connection with the destination before sending a packet.
• When the connection is established , then source sent a sequence of packets to destination one after another.
• In connection-oriented service, there is a relationship between packets. Packets are sent on the same path in sequential
order.
• When all packets of a message have been delivered, the connection is terminated.
• In a connection less service, the source does not makes any connection with the destination.
• source sent a set of packets to destination without establishing connection with destination.
• In connection-less service, there is a no relationship between packets. Packets are sent on the same path or on different
path
Network Layer Protocols
• Internet Protocol version 4 (IPv4) is responsible for packetizing, forwarding, and delivery of a packet at the
network layer.
• The Internet Control Message Protocol version 4 (ICMPv4) helps IPv4 to handle some errors that may occur in the
network-layer delivery.
• The Internet Group Management Protocol (IGMP) is used to help IPv4 in multicasting.
• The Address Resolution Protocol (ARP) is used mapping network-layer addresses to link-layer addresses. (it find
MAC address of device from its IP address.)
• Figure 19.1 shows the positions of these four protocols in the TCP/IP protocol suite.
Internet Protocol(IP)
• IPv4 is an unreliable datagram protocol—a best-effort delivery service.
• The term best-effort means that IPv4 packets can be corrupted, be lost, arrive out of order, or be delayed, and may
create congestion for the network.
• If reliability is important, IPv4 must be paired with a reliable protocol such as TCP.
• An example of best-effort delivery service is the post office.
• The post office does its best to deliver the letters but does not always succeed.
• IPv4 is also a connectionless protocol that uses the datagram approach.
• Datagram approach means that each datagram is handled independently, and each datagram can follow a different
route to the destination.