ch19 (Logicaladdressing)
ch19 (Logicaladdressing)
Logical Addressing
The main objective of router is to connect While the main objective of switch is to
various networks simultaneously. connect various devices simultaneously.
Router is used by LAN as well as MAN. While switch is used by only LAN.
Through the router, data is sent in the While through switch data is sent in the
form of packets. form of frame.
There is less collision taking place in the While there is no collision taking place in
router. full duplex switch.
Logical Addressing: There are two types of addressing performed in the network: logical
addressing and physical addressing.
The data link layer performs the physical addressing, while the network layer does the
logical addressing in the OSI model.
Logical addressing is also used to distinguish between the source and destination
system. The network layer adds a header to the packet, which includes the logical
addresses of both the sender and the receiver.
Internetworking: This is the most important function performed by the network layer of
the OSI model. It establishes the logical connection between nodes in the same or
different networks.
Fragmentation: It is the conversion of data packets into the smallest individual data
units capable of being transmitted in the network.
Network Layer Services:
Solution
We replace each group of 8 bits with its equivalent
decimal number (see Appendix B) and add dots for
separation.
19.11
Example 2
Change the following IPv4 addresses from dotted-decimal
notation to binary notation.
Solution
We replace each decimal number with its binary
equivalent (see Appendix B).
Example 3
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 numbers.
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.
IP address classes
Based on the following rules, IP addresses are categorized into five
classes; A, B, C, D, and E.
•In class A, the first bit of the first byte always remains OFF (0).
•In class B, the first bit of the first byte always remains ON and the
second bit of the first byte always remains OFF.
•In class C, the first two bits of the first byte always remain ON and the
third bit of the first byte always remains OFF.
•In class D, the first three bits of the first byte always remain ON and
the fourth bit of the first byte always remains OFF.
•In class E, the first four bits of the first byte always remain ON.
Network and host addressing
In the second level of the hierarchical addressing scheme, each address is further
divided into two addresses: the network address and host address.
Network addresses are used to combine multiple IP addresses in a group while host
addresses are used to provide a unique identity to each IP address in the group. A
network address is the group address. All group members use the same network
address. A host address is a unique address in the group.
In classful addressing, the address space is divided into
five classes: A, B, C, D, and E.
Finding the classes in binary and dotted-decimal notation
1. Class A:
An IP address is allocated to networks with a high number of hosts in Class A. The
network ID has an 8-bit length. The host ID has a length of 24 bits. The first bit in the
higher order bits of the first octet is always set to 0 in Class A, while the following 7 bits
define the network ID.
7
There are 2 - 2 = 126 networks in the Class A network
24
Total number of Host IDs in Class A = 2 - 2 [1, 67, 77, 214]
31
Total number of connections in Class A = 2 (2, 14, 74, 83, 648)
Organizations needing very large networks, like Indian Railways,
employ class A.
It is a loopback address(localhost
It is a non-routable address.
address).
127.0.0.1 signals the TCP/IP of your computer that it don not want to connect to the
Internet. It states a connection to a server hosted on the same computer. As such,
you'll typically enter it when telling the software to connect to a server via a web
browser or a game.
0.0.0.0, on the other hand, is more of a wildcard than a specific location. When you
use 0.0.0.0, you tell the software to allow connections from every local IP address
possible instead of just 127.0.0.1.
2. Class B:
An IP address is issued to Class B networks, which range in size from modest to big. The
Network ID is made up of 16 bits. The Host ID has a length of 16 bits.
1 1 0
The higher order bits of the first octet are always 10 in Class B, while the
remaining 14 bits define the network ID. The last 16 bits define the Host ID.
•Total number of connections in the class B network is 230 = 1, 07, 37, 41, 824
•Total number of networks available in class B is 214 = 16, 384
•Total number of hosts that can be configured in Class B = 216 - 2 = 165, 534
•Organizations needing medium-sized networks typically utilize class B.
An example of Class B IP address is 168.212.226.204, where *168
212* identifies the network and *226.204* helps you identify the Hut
network host.
3. Class C:
Only small-sized networks are allocated an IP address in Class C. The Network ID
has a length of 24 bits. The host ID has an 8-bit length.
29
Total number of connections in Class C = 2 = 53, 68, 70, 912.
24
1
Total number of networks available in Class C = 2 = 20, 97, 152.
Therefore, there is no requirement to extract the host address from the IP address, so
Class D does not have any subnet mask.
Example for a Class D IP address: 227.21.6.173
5. Class E:
An IP address is utilised in Class E for future usage or for research and development. It
doesn’t have any subnetting. The first octet’s higher order bits are always 1111, while the
remaining bits decide the host ID in any network.
Multicast:
In multicasting, one/more senders and one/more recipients participate in data transfer traffic. In this method traffic
recline between the boundaries of unicast (one-to-one) and broadcast (one-to-all). Multicast lets servers direct single
copies of data streams that are then simulated and routed to hosts that request it. IP multicast requires the support of
some other protocols like IGMP (Internet Group Management Protocol), Multicast routing for its work. Also in
Classful IP addressing Class D is reserved for multicast groups.
Broadcast:
Broadcasting transfer (one-to-all) techniques can be classified into two types:
Limited Broadcasting: Suppose you have to send a stream of packets to all the devices over the network that your
reside, this broadcasting comes in handy. For this to achieve, it will append 255.255.255.255 (all the 32 bits of IP
address set to 1) called Limited Broadcast Address in the destination address of the datagram (packet) header which
is reserved for information transfer to all the recipients from a single client (sender) over the network.
Direct Broadcasting: This is useful when a device in one network wants to transfer packet stream to all the devices
over the other network. This is achieved by translating all the Host ID part bits of the destination address to 1,
referred to as Direct Broadcast Address in the datagram header for information transfer.
Subnet Mask
A subnet mask is used in a process known as subnetting, in
which a large network is divided into smaller networks.
A subnet mask is used to determine the network address and
host address:
In simple words, the subnet mask tells, how many bits in the IP address are
used as the network address and how many bits are left for the host address.
IP addresses are always written with the subnet mask.
Examples of IP addresses
Uses of Subnetting
1. Subnetting helps in organizing the network in an efficient way which
helps in expanding the technology for large firms and companies.
2. Subnetting is used for specific staffing structures to reduce traffic
and maintain order and efficiency.
3. Subnetting divides domains of the broadcast so that traffic is routed
efficiently, which helps in improving network performance.
4. Subnetting is used in increasing network security.
VLSM stands for Variable Length Subnet Mask. It means the size of the subnet
varies according to the needs. In VLSM, the subnet mask is different normally
but it can be same for any two or more subnets depending upon the situation.
FLSM:
Q. Suppose you are network administrator with provided
network 172.16.0.0/24. You need to manage the entire n/w
by dividing into subnetworks so that each of the
Development, Sales, Reception, HR and Production. How
would you do so?
VLSM: Example. An administrator has 192.168.1.0/24 network. The
administrator has three different departments with different number of
hosts. Sales department has 100 computers, Purchase department has 50
computers, Accounts has 25 computers and Management has 5 computers;
the subnets are of fixed size. Calculate the network id, subnet mask, No. of
usable host, host range, broadcast address.
Solution:
1. Allocate the highest range of IPs to the highest requirement, so let's assign
192.168.1.0 /25 (255.255.255.128) to the Sales department. This IP subnet with
Network number 192.168.1.0 has 126 valid Host IP addresses which satisfy the
requirement of the Sales department. The subnet mask used for this subnet has
10000000 as the last octet.
2. Allocate the next highest range, so let's assign 192.168.1.128 /26
(255.255.255.192) to the Purchase department. This IP subnet with Network
number 192.168.1.128 has 62 valid Host IP Addresses which can be easily assigned
to all the PCs of the Purchase department. The subnet mask used has 11000000 in
the last octet.
3. Allocate the next highest range, i.e. Accounts. The requirement of 25 IPs can be
fulfilled with 192.168.1.192 /27 (255.255.255.224) IP subnet, which contains 30
valid host IPs. The network number of Accounts department will be 192.168.1.192.
The last octet of subnet mask is 11100000.
4. Allocate the next highest range to Management. The Management department
contains only 5 computers. The subnet 192.168.1.224 /29 with the Mask
255.255.255.248 has exactly 6 valid host IP addresses. So, this can be assigned
to Management. The last octet of the subnet mask will contain 11111000.
VLSM subnetting:
The given network address is: 192.168.1.0/24
Given requirement in descending order is:
Sales 100
Purchase 50
Accounts 25
Management 5
The complete range of the address in the above provided network is:
192.168.1.0 to 192.168.1.255
Divide the given network consisting 256 hosts into 2 networks with 128 hosts
each:
192.168.1.0-192.168.1.127 (192.168.1.0/25)
192.168.1.128-192.168.1.255 (192.168.1.128/25)
The largest network requirement is of 100 hosts for Sales department. For this, we
need to assign subnetwork with 128 hosts.
Let us assign the first divided subnetwork 192.168.1.0/25 to Sales Department.
We now have remaining subnetwork 192.168.1.128/25.
Dividing this subnetwork, two subnetworks with 64 hosts each are formed.
192.168.1.128 to 192.168.1.191 (192.168.1.128/26)
192.168.1.192 to 192.168.1.255 (192.168.1.192/26)
Our second network requirement is of 50 hosts for Purchase department. We
need to assign subnetwork consisting of 64 hosts.
Dividing this subnetwork, two subnetworks with 16 hosts each are formed.
192.168.1.224 to 192.168.1.239 (192.168.1.224/28)
192.168.1.240 to 192.168.1.255 (192.168.1.240/28)
Our fourth network requirement is of 5 hosts for Management department. We
need to assign subnetwork consisting of 8 hosts, which is sufficient.
So, again dividing the subnetwork 192.168.1.240/28, two subnetworks with 8 hosts
each are formed.
Structure
The CIDR block comprises two parts. These are as follows:
•Block id is used for the network identification, but the number of bits is not pre-defined as it is in the
classful IP addressing scheme.
•Host id is used to identify the host part of the network.
Notation
CIDR IP addresses as follows:
w.x.y.z/n
In the example above, w,x,y,z each defines an 8-
bit binary number, while n tells us about the
number of bits used to identify the network and
is called an IP network prefix or mask.
Block information
Given the following IP address, let's find the network and host bits.
200.56.23.41/28
The following illustration gives a clear understanding of the aforementioned IP
address scheme:
Benefits
Following are the benefits of classless IP addressing:
•Efficient IP address allocations. The Internet Assigned
EXAMPLE:
Disadvantage of Classful Addressing:
Class A with a mask of 255.0.0.0 can support 128 Network, 16,777,216 addresses per network and a total
of 2,147,483,648 addresses.
Class B with a mask of 255.255.0.0 can support 16,384 Network, 65,536 addresses per network and a
total of 1,073,741,824 addresses.
Class C with a mask of 255.255.255.0 can support 2,097,152 Network, 256 addresses per network and a
total of 536,870,912 addresses.
IPv4 IPv6
IPv4 has a 32-bit address length IPv6 has a 128-bit address length
It Supports Manual and DHCP address configuration It supports Auto and renumbering address configuration
The Security feature is dependent on the application IPSEC is an inbuilt security feature in the IPv6 protocol
Fragmentation performed by Sender and forwarding routers In IPv6 fragmentation is performed only by the sender
IPv4 can be converted to IPv6 Not all IPv6 can be converted to IPv4
IPv4 consists of 4 fields which are separated by addresses dot
IPv6 consists of 8 fields, which are separated by a colon (:)
(.)
IPv4’s IP addresses are divided into five different classes. Class
IPv6 does not have any classes of the IP address.
A , Class B, Class C, Class D , Class E.
Internet Protocol version 6 (IPv6)
128
IPv6 is a 128-bits address having an address space of 2 , which is
way bigger than IPv4. IPv6 use Hexa-Decimal format separated by
colon (:) . Notably, IPv6 has drastically increased address
space compared to IPv4.
Both the routing prefix and the subnet ID represent two main
levels in which the address is constructed -- either global or site-
specific. The routing prefix is the number of bits that can be
subdivided -- typically, decided by Internet Registries and Internet
Service Providers (ISPs). In IPv6 address, the leftmost set of
numbers -- the first 48 bits -- is called the site prefix. The subnet ID
is the next 16 bits. The subnet ID lays out site topology. The last
64-bits are called the interface ID, which can be automatically or
manually configured.
Types of IPv6 addresses
There are different types and formats of IPv6 addresses, of which, it's
notable to mention that there are no broadcast addresses in IPv6. Some
examples of IPv6 formats include:
•Global unicast. These addresses are routable on the internet and start
with "2001:" as the prefix group. Global unicast addresses are the
equivalent of IPv4 public addresses.
•Unicast address. Used to identify the interface of an individual node.
•Anycast address. Used to identify a group of interfaces on different
nodes.
•Multicast address. An address used to define Multicast Multicasts are
used to send a single packet to multiple destinations at one time.
•Link local addresses. One of the two internal address types that are
not routed on the internet. Link local addresses are used inside an
internal network, are self-assigned and start with "fe80:" as the prefix
group.
•Unique local addresses. This is the other type of internal address that
is not routed on the internet. Unique local addresses are equivalent to the
IPv4 addresses 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.
Advantages and disadvantages of IPv6 addresses
IPv6 also still uses the same two families of routing protocols –
Interior Gateway Protocol (IGP) and Exterior Gateway Protocol
(EGP).