You are on page 1of 7

Assignment 03

Q1) What is Internet protocol, explain IPv4 address classes.


The Internet Protocol (IP) is a protocol, or set of rules, for routing and addressing  packets of
data so that they can travel across networks and arrive at the correct destination. Data
traversing the Internet is divided into smaller pieces, called packets. IP information is
attached to each packet, and this information helps routers  to send packets to the right
place. Every device or  domain that connects to the Internet is assigned an  IP address, and
as packets are directed to the IP address attached to them, data arrives where it is needed.

Once the packets arrive at their destination, they are handled differently depending on
which transport protocol is used in combination with IP. The most common transport
protocols are TCP and UDP.

Internet Protocol hierarchy contains several classes of IP Addresses to be used efficiently in


various situations as per the requirement of hosts per network. Broadly, the IPv4 Addressing
system is divided into five classes of IP Addresses. All the five classes are identified by the
first octet of IP Address.
Internet Corporation for Assigned Names and Numbers is responsible for assigning IP
addresses.
The first octet referred here is the left most of all. The octets numbered as follows depicting
dotted decimal notation of IP Address −

The number of networks and the number of hosts per class can be derived by this formula −

When calculating hosts' IP addresses, 2 IP addresses are decreased because they cannot be
assigned to hosts, i.e. the first IP of a network is network number and the last IP is reserved
for Broadcast IP.

Class A Address
The first bit of the first octet is always set to 0 (zero). Thus the first octet ranges from 1 –
127, i.e.

Class A addresses only include IP starting from 1.x.x.x to 126.x.x.x only. The IP range
127.x.x.x is reserved for loopback IP addresses.
The default subnet mask for Class A IP address is 255.0.0.0 which implies that Class A
addressing can have 126 networks (27-2) and 16777214 hosts (224-2).
Class A IP address format is thus: 0NNNNNNN.HHHHHHHH.HHHHHHHH.HHHHHHHH

Class B Address

An IP address which belongs to class B has the first two bits in the first octet set to 10, i.e.

Class B IP Addresses range from 128.0.x.x to 191.255.x.x. The default subnet mask for Class
B is 255.255.x.x.
Class B has 16384 (214) Network addresses and 65534 (216-2) Host addresses.
Class B IP address format is: 10NNNNNN.NNNNNNNN.HHHHHHHH.HHHHHHHH

Class C Address

The first octet of Class C IP address has its first 3 bits set to 110, that is −

Class C IP addresses range from 192.0.0.x to 223.255.255.x. The default subnet mask for
Class C is 255.255.255.x.
Class C gives 2097152 (221) Network addresses and 254 (28-2) Host addresses.
Class C IP address format is: 110NNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH

Class D Address

Very first four bits of the first octet in Class D IP addresses are set to 1110, giving a range of

Class D has IP address range from 224.0.0.0 to 239.255.255.255. Class D is reserved for
Multicasting. In multicasting data is not destined for a particular host, that is why there is
no need to extract host address from the IP address, and Class D does not have any subnet
mask.

Class E Address

This IP Class is reserved for experimental purposes only for R&D or Study. IP addresses in
this class ranges from 240.0.0.0 to 255.255.255.254. Like Class D, this class too is not
equipped with any subnet mask.

Q2) Throw some light on Classful IPv4 address ranges.

Classful addressing divides the IPv4 address space (0.0.0.0-255.255.255.255) into 5 classes:
A, B, C, D, and E. However, only A, B, and C are used for network hosts. Class D, which
covers the 224.0.0.0-239.255.255.255 IP address range, is reserved for  multicasting, and
class E (240.0.0.0-255.255.255.255) is reserved for “future use.”

The table below details the default network mask (subnet mask), IP address ranges, number
of networks, and number of addresses per network of each address class.

IPv4 Network Number of Number of IPv4 address


address Mask IPv4 IPv4 range
class Networks addresses
per
network

A 255.0.0.0 128 16,777,214 0.0.0.0 –


127.255.255.255

B 255.255.0.0 16,384 65,534 128.0.0.0 –


191.255.255.255

C 255.255.255. 2,097,152 254 192.0.0.0 –


0 223.255.255.255

As we can see, Class A continues to use the first 8-bits of an address, and may be suitable
for very large networks. Class B is for networks much smaller than Class A, but still large in
their own right. Class C addresses are suitable for small networks.

Q3) Explain I. multicast address II. IPv4 reserved adderesses.


Multicast Address Types and Ranges

The 28 bits after the leading “1110” in the IP address define the multicast group address.
The size of the Class D multicast address space is therefore 228 or 268,435,456 multicast
groups. There is no substructure that defines the use of these 28 bits; there is no specific
concept of a network ID and host ID as in classes A, B and C. However, certain portions of
the address space are set aside for specific uses.  Table 48 and  Figure 63 show the general
allocation of the Class D address space.

Private IP Addresses

Every class of IP, (A, B & C) has some addresses reserved as Private IP addresses. These IPs
can be used within a network, campus, company and are private to it. These addresses
cannot be routed on the Internet, so packets containing these private addresses are
dropped by the Routers.

In order to communicate with the outside world, these IP addresses must have to be
translated to some public IP addresses using NAT process, or Web Proxy server can be used.
The sole purpose to create a separate range of private addresses is to control assignment of
already-limited IPv4 address pool. By using a private address range within LAN, the
requirement of IPv4 addresses has globally decreased significantly. It has also helped
delaying the IPv4 address exhaustion.
IP class, while using private address range, can be chosen as per the size and requirement of
the organization. Larger organizations may choose class A private IP address range where
smaller organizations may opt for class C. These IP addresses can be further sub-netted and
assigned to departments within an organization.

Loopback IP Addresses

The IP address range 127.0.0.0 – 127.255.255.255 is reserved for loopback, i.e. a Host’s self-
address, also known as localhost address. This loopback IP address is managed entirely by
and within the operating system. Loopback addresses, enable the Server and Client
processes on a single system to communicate with each other. When a process creates a
packet with destination address as loopback address, the operating system loops it back to
itself without having any interference of NIC.
Data sent on loopback is forwarded by the operating system to a virtual network interface
within operating system. This address is mostly used for testing purposes like client-server
architecture on a single machine. Other than that, if a host machine can successfully ping
127.0.0.1 or any IP from loopback range, implies that the TCP/IP software stack on the
machine is successfully loaded and working.

Link-local Addresses

In case a host is not able to acquire an IP address from the DHCP server and it has not been
assigned any IP address manually, the host can assign itself an IP address from a range of
reserved Link-local addresses. Link local address ranges from 169.254.0.0 --
169.254.255.255.
Assume a network segment where all systems are configured to acquire IP addresses from a
DHCP server connected to the same network segment. If the DHCP server is not available,
no host on the segment will be able to communicate to any other. Windows (98 or later),
and Mac OS (8.0 or later) supports this functionality of self-configuration of Link-local IP
address. In absence of DHCP server, every host machine randomly chooses an IP address
from the above mentioned range and then checks to ascertain by means of ARP, if some
other host also has not configured itself with the same IP address. Once all hosts are using
link local addresses of same range, they can communicate with each other.
These IP addresses cannot help system to communicate when they do not belong to the
same physical or logical segment. These IPs are also not routable.

Q4) What is IP fragmentation?

When a host sends an IP packet onto the network it cannot be larger than the maximum
size supported by that local network. This size is determined by the network’s data link and
IP Maximum Transmission Units (MTUs) which are usually the same. A typical
contemporary office, campus or data centre network provided over Ethernet will have 1500
byte MTUs.

However, packets that are initially transmitted over a network supporting one MTU may
need be routed across networks (such as a WAN or VPN tunnel) with a smaller MTU. In
these cases, if the packet size exceeds the lower MTU the data in the packet must be
fragmented (if possible). This means it is broken into pieces carried within new packets
(fragments) that are equal to or smaller than the lower MTU. This is called Fragmentation
and the data in these fragments is then typically reassembled when they reach their
destination.

Fragmentation allows for;

 Transport layer protocols to be ignorant of the underlying network architecture,


reducing overheads.
 IP And higher layer protocols to work across variable and diverse network paths
and mediums without the need and overhead of a path discovery protocol (but
see the PMTUD section).

Q5) Explain IPv4 header and protocol numbers.

"IHL (Internet Header Length)" field is 4-bits long binary number. This 4-bit IHL (Internet
Header Length) field gives the "length of IPv4 header" in 32-bit words. Since IHL (Internet
Header Length) is a 4-bit binary number, IHL field in IPv4 header can hold values from 0000
(0 in decimals) to 1111 (15 in decimals). Minimum required field size of IPv4 header is 20
bytes. Minimum required length of an IPv4 header is five 32-bit words (5*32 = 160 bits or 20
bytes). The length of required fields in IPv4 header is 20 bytes. Maximum possible is fifteen
32-bit words (15*32 = 480 bits or 60 bytes). The bit pattern of is IHL field in IPv4 header is
0101, which is equal to five in decimals.

Please refer below image to understand the meaning of 32-bit words of IPv4 header.
Numbered at right-side are the required fields of IPv4 header.

The 8-bit "Protocol" field indicates the protocol that will receive the data payload. For
example, ICMP (Internet Control Message Protocol) has a Protocol number of 1, TCP
(Transmission Control Protocol) has a Protocol number of 6, UDP (User Datagram Protocol)
has a Protocol number of 17, RDP (Reliable Data Protocol) has a Protocol number of 27, ESP
(Encapsulating Security Payload) has a Protocol number of 50 etc.

The Protocol field in IPv4 header is used to demultiplex an IPv4 packet to a Transport layer
(Layer 4) protocol. Following table lists important Protocol numbers. You may find latest
Protocol Number Assignments from IANA Protocol Number Assignments page.

Q6) Explain differentiated services.


Differentiated Services (DiffServ, or DS) is a  protocol for specifying and controlling network
traffic by class so that certain types of traffic get precedence - for example, voice traffic,
which requires a relatively uninterrupted flow of data, might get precedence over other
kinds of traffic. Differentiated Services is the most advanced method for managing traffic in
terms of what is called Class of Service (CoS). Unlike the earlier mechanisms of 802.1p
tagging and Type of Service (ToS), Differentiated Services avoids simple priority tagging and
depends on more complex policy or rule statements to determine how to forward a given
network packet. An analogy is made to travel services, in which a person can choose among
different modes of travel - train, bus, airplane - degree of comfort, the number of stops on
the route, standby status, the time of day or period of year for the trip, and so forth. For a
given set of packet travel rules, a packet is given one of 64 possible forwarding behaviors -
known as per hop behaviors (PHBs). A six-bit field, known as the Differentiated Services
Code Point (DSCP), in the Internet Protocol (IP)  header  specifies the per hop behavior for a
given flow of packets.

You might also like