Chapter 5: Reference Model and IP Addressing
5.1) Open System Interconnection
OSI or Open System Interconnection model was developed by
International Standards Organization (ISO). It gives a layered
networking framework that conceptualizes how communications should
be done between heterogeneous systems. It has seven interconnected
layers. The seven layers of the
OSI Model are a physical
layer, data link layer, network
layer, transport layer, session
layer, presentation layer, and
application layer, as shown in
the following diagram −
The modern Internet is not
based on OSI, but on the
simpler TCP/IP model.
However, the OSI 7-layer
model is still widely used, as it
helps visualize and
communicate how networks
operate, and helps isolate and
troubleshoot networking
problems.
OSI was introduced in 1983 by representatives of the major computer
and telecom companies, and was adopted by ISO as an international
standard in 1984.
The physical layer, data link layer and the network layer are the
network support layers. The layers manage a physical transfer of data
from one device to another. Session layer, presentation layer, and
application layer are the user support layers. These layers allow
communication among unrelated software in dissimilar environments.
Transport layer links the two groups.
o OSI stands for Open System Interconnection is a reference
model that describes how information from a software application
in one computer moves through a physical medium to the software
application in another computer.
o OSI consists of seven layers, and each layer performs a particular
network function.
o OSI model was developed by the International Organization for
Standardization (ISO) in 1984, and it is now considered as an
architectural model for the inter-computer communications.
o OSI model divides the whole task into seven smaller and
manageable tasks. Each layer is assigned a particular task.
o Each layer is self-contained, so that task assigned to each layer can
be performed independently.
Characteristics of OSI Model:
o The OSI model is divided into two layers: upper layers and lower
layers.
o The upper layer of the
OSI model mainly deals
with the application
related issues, and they
are implemented only in
the software. The
application layer is
closest to the end user.
Both the end user and the
application layer interact
with the software applications. An upper layer refers to the layer
just above another layer.
o The lower layer of the OSI model deals with the data transport
issues. The data link layer and the physical layer are implemented
in hardware and software. The physical layer is the lowest layer of
the OSI model and is closest to the physical medium. The physical
layer is mainly responsible for placing the information on the
physical medium.
The advantages of the OSI model are
It is a generic model and acts as a guidance tool to develop any
network model.
It is a layered model. Changes are one layer do not affect other
layers, provided that the interfaces between the layers do not
change drastically.
It distinctly separates services, interfaces, and protocols. Hence, it
is flexible in nature. Protocols in each layer can be replaced very
conveniently depending upon the nature of the network.
It supports both connection-oriented services and connectionless
services.
The disadvantages of the OSI model are
It is purely a theoretical model that does not consider the
availability of appropriate technology. This restricts its practical
implementation.
The launching timing of this model was inappropriate. When OSI
appeared, the TCP/IP protocols were already implemented. So, the
companies were initially reluctant to use it.
The OSI model is very complex. The initial implementation was
cumbersome, slow and costly.
Though there are many layers, some of the layers like the session
layer and presentation layer have very little functionality when
practically deployed.
There is a duplication of services in various layers. Services like
addressing, flow control and error control are offered by multiple
layers.
The standards of OSI model are theoretical and do not offer
adequate solutions for practical network implementation.
After being launched, the OSI model did not meet the practical
needs as well as the TCP/IP model. So it was labeled as inferior
quality.
TCP/IP model was very much preferred by the academia. It was
believed that OSI was a product of the European communities and
the US government, who were trying to force an inferior model to
researchers and programmers. Hence, there was considerable
resistance in adopting it.
Layers of OSI Model
There are the seven OSI layers. Each layer has different functions. A list
of seven layers are given below:
1. Physical Layer
2. Data-Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
1) Physical layer
This is the shortest layer in the model. The physical layer is used for
transmitting bits from one device to the other device. It is not involved
with the bit’s representation, but it manages the physical relation to the
structure with communication and signal acceptance.
o The main functionality of the physical layer is to transmit the
individual bits from one node to another node.
o It is the lowest layer of the OSI model.
o It establishes, maintains and deactivates the physical connection.
o It specifies the mechanical, electrical and procedural network
interface specifications.
Functions of a Physical layer:
o Line Configuration: It defines the way how two or more devices
can be connected physically.
o Data Transmission: It defines the transmission mode whether it
is simplex, half-duplex or full-duplex mode between the two devices
on the network.
o Topology: It defines the way how network devices are arranged.
o Signals: It determines the type of the signal used for transmitting
the information.
2) Data-Link Layer
It takes the physical layer’s bits and detects an error. This establishes an
error-free communications path between the network nodes over the
physical medium. Moreover, it frames the messages for transmission and
tests the integrity of received messages. It manages the access to and
uses the medium and also ensures the proper sequence of the transmitted
data.
o This layer is responsible for the error-free transfer of data frames.
o It defines the format of the data on the network.
o It provides a reliable and efficient communication between two or
more devices.
o It is mainly responsible for the unique identification of each device
that resides on a local network.
o It contains two sub-layers:
o Logical Link Control Layer
o It is responsible for transferring the packets to the
Network layer of the receiver that is receiving.
o It identifies the address of the network layer protocol
from the header.
o It also provides flow control.
o Media Access Control Layer
o A Media access control layer is a link between the
Logical Link Control layer and the network's physical
layer.
o It is used for transferring the packets over the network.
Functions of the Data-link layer
o Framing: The data link layer translates the physical's raw bit
stream into packets known as Frames. The Data link layer adds the
header and trailer to the frame. The header which is added to the
frame contains the hardware destination and source address.
o Physical Addressing: The Data link layer adds a header to the
frame that contains a destination address. The frame is
transmitted to the destination address mentioned in the header.
o Flow Control: Flow control is the main functionality of the Data-
link layer. It is the technique through which the constant data rate
is maintained on both the sides so that no data get corrupted. It
ensures that the transmitting station such as a server with higher
processing speed does not exceed the receiving station, with lower
processing speed.
o Error Control: Error control is achieved by adding a calculated
value CRC (Cyclic Redundancy Check) that is placed to the Data
link layer's trailer which is added to the message frame before it is
sent to the physical layer. If any error seems to occur, then the
receiver sends the acknowledgment for the retransmission of the
corrupted frames.
o Access Control: When two or more devices are connected to the
same communication channel, then the data link layer protocols are
used to determine which device has control over the link at a given
time.
3) Network Layer
The network layer is the makeup software that addresses the protocol
data units (PDUs) and transfers them to the ultimate destination.
This is done by setting up the suitable paths between the multiple
nodes. The primary objective of this layer is to control the service of
the subnet. It is the layer, which supports Internet Protocol (IP) to use
it. It is mainly responsible for delivering routing services from source
to destination across the Internet.
o It is a layer 3 that manages device addressing, tracks the location
of devices on the network.
o It determines the best path to move data from source to the
destination based on the network conditions, the priority of service,
and other factors.
o The Data link layer is responsible for routing and forwarding the
packets.
o Routers are the layer 3 devices, they are specified in this layer and
used to provide the routing services within an internetwork.
o The protocols used to route the network traffic are known as
Network layer protocols. Examples of protocols are IP and Ipv6.
Functions of Network Layer:
o Internetworking: An internetworking is the main responsibility
of the network layer. It provides a logical connection between
different devices.
o Addressing: A Network layer adds the source and destination
address to the header of the frame. Addressing is used to identify
the device on the internet.
o Routing: Routing is the major component of the network layer, and
it determines the best optimal path out of the multiple paths from
source to the destination.
o Packetizing: A Network Layer receives the packets from the
upper layer and converts them into packets. This process is known
as Packetizing. It is achieved by internet protocol (IP).
4) Transport Layer
This layer guarantees the orderly and reliable delivery of data between
the end systems after accepting the data from the session layer. The
session layer maps the data to the Network layer, and it provides that
the packets appear correctly at the receiving side.
o The Transport layer is a Layer 4 ensures that messages are
transmitted in the order in which they are sent and there is no
duplication of data.
o The main responsibility of the transport layer is to transfer the data
completely.
o It receives the data from the upper layer and converts them into
smaller units known as segments.
o This layer can be termed as an end-to-end layer as it provides a
point-to-point connection between source and destination to deliver
the data reliably.
The two protocols used in this layer are:
o Transmission Control Protocol
o It is a standard protocol that allows the systems to
communicate over the internet.
o It establishes and maintains a connection between hosts.
o When data is sent over the TCP connection, then the TCP
protocol divides the data into smaller units known as
segments. Each segment travels over the internet using
multiple routes, and they arrive in different orders at the
destination. The transmission control protocol reorders the
packets in the correct order at the receiving end.
o User Datagram Protocol
o User Datagram Protocol is a transport layer protocol.
o It is an unreliable transport protocol as in this case receiver
does not send any acknowledgment when the packet is
received, the sender does not wait for any acknowledgment.
Therefore, this makes a protocol unreliable.
Functions of Transport Layer:
o Service-point addressing: Computers run several programs
simultaneously due to this reason, the transmission of data from
source to the destination not only from one computer to another
computer but also from one process to another process. The
transport layer adds the header that contains the address known
as a service-point address or port address. The responsibility of the
network layer is to transmit the data from one computer to another
computer and the responsibility of the transport layer is to transmit
the message to the correct process.
o Segmentation and reassembly: When the transport layer
receives the message from the upper layer, it divides the message
into multiple segments, and each segment is assigned with a
sequence number that uniquely identifies each segment. When the
message has arrived at the destination, then the transport layer
reassembles the message based on their sequence numbers.
o Connection control: Transport layer provides two services
Connection-oriented service and connectionless service. A
connectionless service treats each segment as an individual packet,
and they all travel in different routes to reach the destination. A
connection-oriented service makes a connection with the transport
layer at the destination machine before delivering the packets. In
connection-oriented service, all the packets travel in the single
route.
o Flow control: The transport layer also responsible for flow control
but it is performed end-to-end rather than across a single link.
o Error control: The transport layer is also responsible for Error
control. Error control is performed end-to-end rather than across
the single link. The sender transport layer ensures that message
reach at the destination without any error.
5) Session Layer
This layer is vital for establishing, controlling, and arbitrating the
dialogues between the communication software. It is also answerable for
the orderly recovery from failures by implementing appropriate check
pointing mechanisms.
o It is a layer 3 in the OSI model.
o The Session layer is used to establish, maintain and synchronizes
the interaction between communicating devices.
Functions of Session layer:
o Dialog control: Session layer acts as a dialog controller that
creates a dialog between two processes or we can say that it allows
the communication between two processes which can be either half-
duplex or full-duplex.
o Synchronization: Session layer adds some checkpoints when
transmitting the data in a sequence. If some error occurs in the
middle of the transmission of data, then the transmission will take
place again from the checkpoint. This process is known as
Synchronization and recovery.
6) Presentation Layer
The presentation layer performs the functions related to the syntax and
semantics of the information transmitted. These functions include
formatting and displaying the received data by terminals and printers.
This layer is responsible for rectifying those differences by resorting to
mechanisms that change the local syntax to a typical data exchange.
o A Presentation layer is mainly concerned with the syntax and
semantics of the information exchanged between the two systems.
o It acts as a data translator for a network.
o This layer is a part of the operating system that converts the data
from one presentation format to another format.
o The Presentation layer is also known as the syntax layer.
Functions of Presentation layer:
o Translation: The processes in two systems exchange the
information in the form of character strings, numbers and so on.
Different computers use different encoding methods, the
presentation layer handles the interoperability between the
different encoding methods. It converts the data from sender-
dependent format into a common format and changes the common
format into receiver-dependent format at the receiving end.
o Encryption: Encryption is needed to maintain privacy. Encryption
is a process of converting the sender-transmitted information into
another form and sends the resulting message over the network.
o Compression: Data compression is a process of compressing the
data, i.e., it reduces the number of bits to be transmitted. Data
compression is very important in multimedia such as text, audio,
video.
7) Application Layer
This layer provides the services for user and software tasks. It
determines how the user will use the data web. It enables the client to
use the network. For example, it provides the network-based services to
the end-user.
o An application layer serves as a window for users and application
processes to access network service.
o It handles issues such as network transparency, resource
allocation, etc.
o An application layer is not an application, but it performs the
application layer functions.
o This layer provides the network services to the end-users.
Functions of Application layer:
o File transfer, access, and management (FTAM): An
application layer allows a user to access the files in a remote
computer, to retrieve the files from a computer and to manage the
files in a remote computer.
o Mail services: An application layer provides the facility for email
forwarding and storage.
o Directory services: An application provides the distributed
database sources and is used to provide that global information
about various objects.
5.2) TCP/IP model
TCP/IP Reference Model is a four-layered suite of communication
protocols. It was developed by the DoD (Department of Defence) in the
1960s. It is named after the two main protocols that are used in the
model, namely, TCP and IP. TCP stands for Transmission Control
Protocol and IP stands for Internet Protocol.
o The TCP/IP model was developed prior to the OSI model.
o The TCP/IP model is not exactly similar to the OSI model.
o The TCP/IP model consists of five layers: the application layer,
transport layer, network layer, data link layer and physical layer.
o The first four layers provide physical standards, network interface,
internetworking, and transport functions that correspond to the
first four layers of the OSI model and these four layers are
represented in TCP/IP model by a single layer called the application
layer.
o TCP/IP is a hierarchical protocol made up of interactive modules,
and each of them provides specific functionality.
Here, hierarchical means that each upper-layer protocol is supported by
two or more lower-level protocols.
The following diagram shows the layers and the protocols in each of the
layers −
Functions of TCP/IP layers:
1)Network Access Layer
o A network layer is the lowest layer of the TCP/IP model.
o A network layer is the combination of the Physical layer and Data
Link layer defined in the OSI reference model.
o It defines how the data should be sent physically through the
network.
o This layer is mainly responsible for the transmission of the data
between two devices on the same network.
o The functions carried out by this layer are encapsulating the IP
datagram into frames transmitted by the network and mapping of
IP addresses into physical addresses.
o The protocols used by this layer are Ethernet, token ring, FDDI,
X.25, frame relay.
2)Internet Layer
o An internet layer is the second layer of the TCP/IP model.
o An internet layer is also known as the network layer.
o The main responsibility of the internet layer is to send the packets
from any network, and they arrive at the destination irrespective of
the route they take.
Following are the protocols used in this layer are:
IP Protocol: IP protocol is used in this layer, and it is the most
significant part of the entire TCP/IP suite.
Following are the responsibilities of this protocol:
o IP Addressing: This protocol implements logical host addresses
known as IP addresses. The IP addresses are used by the internet
and higher layers to identify the device and to provide internetwork
routing.
o Host-to-host communication: It determines the path through
which the data is to be transmitted.
o Data Encapsulation and Formatting: An IP protocol accepts
the data from the transport layer protocol. An IP protocol ensures
that the data is sent and received securely, it encapsulates the data
into message known as IP datagram.
o Fragmentation and Reassembly: The limit imposed on the size
of the IP datagram by data link layer protocol is known as
Maximum Transmission unit (MTU). If the size of IP datagram is
greater than the MTU unit, then the IP protocol splits the datagram
into smaller units so that they can travel over the local network.
Fragmentation can be done by the sender or intermediate router.
At the receiver side, all the fragments are reassembled to form an
original message.
o Routing: When IP datagram is sent over the same local network
such as LAN, MAN, WAN, it is known as direct delivery. When
source and destination are on the distant network, then the IP
datagram is sent indirectly. This can be accomplished by routing
the IP datagram through various devices such as routers.
ARP Protocol
o ARP stands for Address Resolution Protocol.
o ARP is a network layer protocol which is used to find the physical
address from the IP address.
o The two terms are mainly associated with the ARP Protocol:
o ARP request: When a sender wants to know the physical
address of the device, it broadcasts the ARP request to the
network.
o ARP reply: Every device attached to the network will accept
the ARP request and process the request, but only recipient
recognize the IP address and sends back its physical address
in the form of ARP reply. The recipient adds the physical
address both to its cache memory and to the datagram header
ICMP Protocol
o ICMP stands for Internet Control Message Protocol.
o It is a mechanism used by the hosts or routers to send notifications
regarding datagram problems back to the sender.
o A datagram travels from router-to-router until it reaches its
destination. If a router is unable to route the data because of some
unusual conditions such as disabled links, a device is on fire or
network congestion, then the ICMP protocol is used to inform the
sender that the datagram is undeliverable.
o An ICMP protocol mainly uses two terms:
o ICMP Test: ICMP Test is used to test whether the
destination is reachable or not.
o ICMP Reply: ICMP Reply is used to check whether the
destination device is responding or not.
o The core responsibility of the ICMP protocol is to report the
problems, not correct them. The responsibility of the correction lies
with the sender.
o ICMP can send the messages only to the source, but not to the
intermediate routers because the IP datagram carries the
addresses of the source and destination but not of the router that it
is passed to.
3)Transport Layer
The transport layer is responsible for the reliability, flow control, and
correction of data which is being sent over the network.
The two protocols used in the transport layer are User Datagram
protocol and Transmission control protocol.
o User Datagram Protocol (UDP)
o It provides connectionless service and end-to-end delivery of
transmission.
o It is an unreliable protocol as it discovers the errors but not
specify the error.
o User Datagram Protocol discovers the error, and ICMP
protocol reports the error to the sender that user datagram
has been damaged.
o UDP consists of the following fields:
Source port address: The source port address is the address
of the application program that has created the message.
Destination port address: The destination port address is
the address of the application program that receives the
message.
Total length: It defines the total number of bytes of the user
datagram in bytes.
Checksum: The checksum is a 16-bit field used in error
detection.
o UDP does not specify which packet is lost. UDP contains only
checksum; it does not contain any ID of a data segment.
o Transmission Control Protocol (TCP)
o It provides a full transport layer services to applications.
o It creates a virtual circuit between the sender and receiver,
and it is active for the duration of the transmission.
o TCP is a reliable protocol as it detects the error and
retransmits the damaged frames. Therefore, it ensures all the
segments must be received and acknowledged before the
transmission is considered to be completed and a virtual
circuit is discarded.
o At the sending end, TCP divides the whole message into
smaller units known as segment, and each segment contains
a sequence number which is required for reordering the
frames to form an original message.
o At the receiving end, TCP collects all the segments and
reorders them based on sequence numbers.
4)Application Layer
o An application layer is the topmost layer in the TCP/IP model.
o It is responsible for handling high-level protocols, issues of
representation.
o This layer allows the user to interact with the application.
o When one application layer protocol wants to communicate with
another application layer, it forwards its data to the transport
layer.
o There is an ambiguity occurs in the application layer. Every
application cannot be placed inside the application layer except
those who interact with the communication system. For example:
text editor cannot be considered in application layer while web
browser using HTTP protocol to interact with the network
where HTTP protocol is an application layer protocol.
Following are the main protocols used in the application layer:
o HTTP: HTTP stands for Hypertext transfer protocol. This protocol
allows us to access the data over the world wide web. It transfers
the data in the form of plain text, audio, video. It is known as a
Hypertext transfer protocol as it has the efficiency to use in a
hypertext environment where there are rapid jumps from one
document to another.
o SNMP: SNMP stands for Simple Network Management Protocol.
It is a framework used for managing the devices on the internet by
using the TCP/IP protocol suite.
o SMTP: SMTP stands for Simple mail transfer protocol. The TCP/IP
protocol that supports the e-mail is known as a Simple mail transfer
protocol. This protocol is used to send the data to another e-mail
address.
o DNS: DNS stands for Domain Name System. An IP address is used
to identify the connection of a host to the internet uniquely. But,
people prefer to use the names instead of addresses. Therefore, the
system that maps the name to the address is known as Domain
Name System.
o TELNET: It is an abbreviation for Terminal Network. It
establishes the connection between the local computer and remote
computer in such a way that the local terminal appears to be a
terminal at the remote system.
o FTP: FTP stands for File Transfer Protocol. FTP is a standard
internet protocol used for transmitting the files from one computer
to another computer.
Following are the differences between OSI and TCP/IP Reference Model
OSI TCP/IP
OSI represents Open System TCP/IP model represents the
Interconnection. Transmission Control Protocol /
Internet Protocol.
OSI is a generic, protocol TCP/IP model depends on
independent standard. It is acting standard protocols about which
as an interaction gateway between the computer network has created.
the network and the final-user. It is a connection protocol that
assigns the network of hosts over
the internet.
The OSI model was developed first, The protocols were created first
and then protocols were created to and then built the TCP/IP model.
fit the network architecture’s needs.
It provides quality services. It does not provide quality
services.
OSI TCP/IP
The OSI model represents defines It does not mention the services,
administration, interfaces and interfaces, and protocols.
conventions. It describes clearly
which layer provides services.
The protocols of the OSI model are The TCP/IP model protocols are
better unseen and can be returned not hidden, and we cannot fit a
with another appropriate protocol new protocol stack in it.
quickly.
It is difficult as distinguished to It is simpler than OSI.
TCP/IP.
It provides both connection and It provides connectionless
connectionless oriented transmission in the network layer
transmission in the network layer; and supports connecting and
however, only connection-oriented connectionless-oriented
transmission in the transport layer. transmission in the transport
layer.
It uses a horizontal approach. It uses a vertical approach.
The smallest size of the OSI header The smallest size of the TCP/IP
is 5 bytes. header is 20 bytes.
Protocols are unknown in the OSI In TCP/IP, returning protocol is
model and are returned while the not difficult.
technology modifies.
5.3. Protocols
A network or communication protocol is a set of rules for communicating
between computing devices which governs format, timing, sequencing,
and error control. Without these rules, the computer cannot make sense
incoming/outgoing bits A protocol set a rules to identify one another in a
network, the form of the data during transmission process, and how data
is processed before it reaches its final destination. Computers can
communicate only if the protocol used by a computer in the network is
compatible with the protocol used by another computer. The rules
include guidelines which regulates a network access method, allowed
physical topologies, types of cabling, and the speed of data transfer.
Most commonly used network protocols
1. TCP/IP (Transmission Control Protocol/Internet Protocol):
TCP/IP is a layered set of protocols TCP is reliable, but complex
transport-layer protocol. It is stream connection-oriented and reliable
transport protocol. TCP/IP is the protocol used by Internet. It adds
connection-oriented and reliability features. TCP is responsible for
making sure that the data is transmitted to other end. It keeps track of
what is sent, and re transmits any data that has not reached its
destination. The Internet Protocol (IP) is the principal communication
protocol used for transmitting data packets across and network using the
Internet Protocol Suite. Internet exist due to TCP/IP.
2. FTP (File Transfer Protocol): This protocol is used for transferring
data between client and server over TCP/IP (Internet). Hence, it is
responsible for uploading and downloading files to and from the server.
3. UDP (User Datagram Protocol): UDP is simple, connection less,
unreliable transport protocol. It performs very limited error checking. It
is mainly used for transmitting multimedia data, which requires faster
transmission and error checking is not used.
4. SMTP (Simple Mail Transfer Protocol): SMTP is a standard
protocol for transmitting electronic mail (email) by the internet. It is a
Internet mail protocol. It is a TCP/IP protocol used to send emails
5. POP (Post Office Protocol): POP is also a protocol for transmitting
email. It is simple but has limited functionality. It is an application layer
Internet standard protocol used by clients to access e-mail from a server
over a TCP/IP connection i.e. internet. POP3 (POP version 3) is used at
present. POP3 is supported by most modern webmail services such as
Gmail and Yahoo mail.
6. HTTP (Hypertext Transfer Protocol): HTTP networking protocol
for distributed, collaborative, hypermedia information systems. It is
used transmitting hypertext or HTML based document. It is the
foundation of data communication for the World Wide Web used by web
browser to communication with respective servers.
7. HTTPS (Hypertext Transfer Protocol Secure): HTTPS is
combination of Protocol with the SSL/TLS protocol to provide encrypted
identification of a network. HTTPS connections are often used in World
Wide Web for sensitive transactions. The main objective of HTTPS is to
create a secure channel over an insecure network
5.4) IP address and its Class
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 [Link] which
implies that Class A addressing can have 126 networks (27-2) and
16777214 hosts (224-2).
Class A IP address format is
thus: [Link]
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: [Link]
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: [Link]
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 [Link] to [Link]. 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 [Link] to
[Link]. Like Class D, this class too is not equipped with any
subnet mask.
5.6) Sub Netting
Each IP class is equipped with its own default subnet mask which bounds
that IP class to have prefixed number of Networks and prefixed number
of Hosts per network. Classful IP addressing does not provide any
flexibility of having less number of Hosts per Network or more Networks
per IP Class.
CIDR or Classless Inter Domain Routing provides the flexibility of
borrowing bits of Host part of the IP address and using them as Network
in Network, called Subnet. By using subnetting, one single Class A IP
address can be used to have smaller sub-networks which provides better
network management capabilities.
Class A Subnets
In Class A, only the first octet is used as Network identifier and rest of
three octets are used to be assigned to Hosts (i.e. 16777214 Hosts per
Network). To make more subnet in Class A, bits from Host part are
borrowed and the subnet mask is changed accordingly.
For example, if one MSB (Most Significant Bit) is borrowed from host bits
of second octet and added to Network address, it creates two Subnets
(21=2) with (223-2) 8388606 Hosts per Subnet.
The Subnet mask is changed accordingly to reflect subnetting. Given
below is a list of all possible combination of Class A subnets −
In case of subnetting too, the very first and last IP address of every
subnet is used for Subnet Number and Subnet Broadcast IP address
respectively. Because these two IP addresses cannot be assigned to hosts,
sub-netting cannot be implemented by using more than 30 bits as
Network Bits, which provides less than two hosts per subnet.
Class B Subnets
By default, using Classful Networking, 14 bits are used as Network bits
providing (214) 16384 Networks and (216-2) 65534 Hosts. Class B IP
Addresses can be subnetted the same way as Class A addresses, by
borrowing bits from Host bits. Below is given all possible combination of
Class B subnetting −
Class C Subnets
Class C IP addresses are normally assigned to a very small size network
because it can only have 254 hosts in a network. Given below is a list of
all possible combination of subnetted Class B IP address −
Some important formula used for network configuration
Number of Addresses in Block => N=232-n (where n is prefix length)
First address/Network Address = (any address) AND (network
mask)
Last Address/Broad Cast Address = (any address) OR
[NOT(network mask)]
Question In a block of addresses, we know the IP address of one
host is [Link]/26. What is the first address (network
address) and the last address (limited broadcast address) in this
block?
Solution.
Given IP Address => [Link]/26
Since the prefix is 26(8+8+8+2),therefore subnet mask will be
[Link].
Using
First address = (any address) AND (network mask) ,
Last Address = (any address) OR [NOT(network mask)], we get
First Address = ([Link]) AND ([Link]) = [Link]/26
Last Address = (182.44..82.16) OR ([Link]) = [Link]/26
Question: Find the range of addresses in blocks [Link]/29
Solution:
Here network bits are 29 (8+8+8+5) therefore subnet mask is
[Link]
Using First address = (any address) AND (network mask) ,
Last Address = (any address) OR [NOT(network mask)],
we get
First Address = ([Link]) AND ([Link]) = [Link]/29
Last Address = ([Link]) OR ([Link]) = [Link]/29
Total Address is block = 23 = 8
Question: An organization is granted the block [Link]/8.
a. Find the subnet mask.
b. Find the number of addresses in each subnet.
c. Find the first and the last address in the first subnet.
Solution:
Given bits allocation (8+24)
To create 500 fixed length subnet, we use value near to power of 2
(which is 512), so we create 512 subnet, therefore we need 9 bits.
a. Subnet mask => [Link]
b. Number of addresses in each subnet => 215
c. First and the last address in the first subnet
Using First address = (any address) AND (network mask) ,
Last Address = (any address) OR [NOT(network mask)],
we get
First Address = ([Link]) AND ([Link]) = [Link]/17
Last Address = ([Link]) OR ([Link]) = [Link]/17
Question: You have an interface on a router with the IP address
of [Link]/29. What is the broadcast address the hosts will
use on this LAN?
Solution :
Find the last address of this block(this is broadcast address)
Given bits allocation (29+3) =>29 means 8+8+8+5, Subnet Mask =
[Link]
Last Address = (any address) OR [NOT(network mask)], we get
Last Address = ([Link]) OR ([Link]) = [Link]/29
Question: what is the last valid host on the subnetwork
[Link]/26?
Solution:
Given bits allocation (26+6) =>26 means 8+8+8+2, Subnet Mask =
[Link]
Last valid host is the second last address as the last address of block is
broadcast address.
Last Address = (any address) OR [NOT(network mask)], we get
Last Address = ([Link]) OR ([Link]) = [Link]/26
So, Last Valid host is [Link]/26
Question: Find the number of addresses in a range if the first
address is [Link] and the last address is [Link].
Solution:
Find the difference by subtracting each octet of the first address from
the corresponding octet of last address, we get [Link]
To find the number of addresses(in decimal), we convert it to base 10
and finally add 1 to the result.[ex. range between 5 to 10 is 6 i.e. 10-
5=5+1 =6]
Number of addresses = (0×2563 + 0×2562+ 2×2561+ 255×2560) + 1
= (0+0+512+255)+1 = 768
Question: Find the netid and the hostid of the following
classfull addresses:
a. [Link] b. [Link]
Solution :
Classes have following range [0-127, 128-191, 192-223, 224-239, 240-
255]
a). [Link] is class A Address, therefore bits allocation is ( 8 + 24)
So, Netid = 114 and Hostid = 34.2.8
b).[Link] is class C Address, therefore bits allocation is (24 + 8)
So, Netid = 208.34.54 and Hostid = 12