0% found this document useful (0 votes)
5 views

2

The document discusses network architecture, focusing on the OSI reference model and its seven layers, which facilitate inter-computer communication. It details the functions and characteristics of the physical, data link, and network layers, emphasizing their roles in data transmission, error handling, and network addressing. The OSI model serves as a standard framework for understanding and designing network protocols and interactions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

2

The document discusses network architecture, focusing on the OSI reference model and its seven layers, which facilitate inter-computer communication. It details the functions and characteristics of the physical, data link, and network layers, emphasizing their roles in data transmission, error handling, and network addressing. The OSI model serves as a standard framework for understanding and designing network protocols and interactions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 90

4.

0 Introduction
You can build networks with different architecture. One approach is to build a
network based on monolithic architecture. In monolithic architecture, the whole
system functions as single unit. Another approach is to build networks in layer s. In
this approach, different payers perform different tasks of the network. Each layer is
responsible for a set of well-defined tasks.
Open System Interconnect (OSI) reference model developed by International
Organization for Standardization (ISO) is a standard network reference model. OSI
reference model sets a standard against which all other models are explained and
benchmarked.
The TCP/IP model or Internet reference model, sometimes called the DoD
model (DoD, Department of Defense) ARPANET reference model, is a layered
abstract description for communications and computer network protocol design. It was
created in the 1970s by DARPA for use in developing the Internet's protocols, and the
structure of the Internet is still closely reflected by the TCP/IP model.
4.1 OSI Reference Model:
The ISO (International Standards Organization) has created a layered model
called the OSI (Open Systems Interconnect) model to describe defined layers in a
network operating system. The purpose of the layers is to provide clearly defined
functions to improve inter network connectivity between "computer” manufacturing
companies. Each layer has a standard defined input and a standard defined output.
The OSI reference model is a conceptual model composed of seven layers, each
specifying particular network functions. The model was developed by the International
Organization for Standardization (ISO) in 1984, and it is now considered the primary
architectural model for inter computer communications. The OSI model divides the
tasks involved with moving information between networked computers into seven
smaller, more manageable task groups. A task or group of tasks is then assigned to
each of the seven OSI layers. Each layer is reasonably self-contained so that the tasks
assigned to each layer can be implemented independently. This enables the solutions
offered by one layer to be updated without adversely affecting the other layers. The
following list details the seven layers of the Open System Interconnection (OSI)
reference model:

 Layer 7—Application

 Layer 6—Presentation

 Layer 5—Session

 Layer 4—Transport

 Layer 3—Network

 Layer 2—Data link

 Layer 1—Physical
(Remember the sentence "All People Seem To Need Data Processing.” Each
capital bold letter indicates name of seven layers.)
The principles that were applied to arrive at the seven layers are as follows:
1. A layer should be created where a different level of abstraction is needed.
2. Each layer should perform a well defined function.
3. The function of each layer should be chosen to define internationally
standardized protocols.
4. The layer boundaries should be chosen to minimize the information flow across
the interfaces.
5. The number of layers should be large enough that distinct functions need not be
thrown together in the same layer out of necessity, and small enough that the
architecture does not become unwieldy.
4.1.1 Characteristics of the OSI Layers
The seven layers of the OSI reference model can be divided into two
categories: upper layers and lower layers. Figure 4-1 illustrates the division between
the upper and lower OSI layers.
The upper layers of the OSI model deal with application issues and generally
are implemented only in software. The highest layer, the application layer, is closest to
the end user. Both users and application layer processes interact with software
applications that contain a communications component. The term upper layer is
sometimes used to refer to any layer above another layer in the OSI model.
The lower layers of the OSI model handle data transport issues. The physical
layer and the data link layer are implemented in hardware and software. The lowest
layer, the physical layer, is closest to the physical network medium (the network
cabling, for example) and is responsible for actually placing information on the
medium.

Application
Application Presentation
Session
Transport
Network
Data Transport
Data link
Physical

Figure 4.1 Two Sets of Layers Make Up the OSI Layers


4.2 Functions and Services Provided by OSI Model Layers
The OSI reference model is shown in Figure 4.2. It has seven layers as follows:

Name of unit
Layer exchanged
Application Protocol
7 Application Application ADPU

Interface
Presentation Protocol Presentation PPDU
6 Presentation
Interface
Session Protocol
5 Session Session SPDU

Transport Protocol
4 Transport Transport DPDU
Communication Subnet Boundary
Internal Subnet Protocol

3 Network Network Network Network Packet

2 Data Link Data Link Data Link Data Link Frame

1 Physical Physical Physical Physical Bit

Host A Router Router Host B

Network layer host-router Protocol


Data Link layer host-router Protocol
Physical layer host-router Protocol

Figure
4.2.1 The Physical Layer 4.2 The
(Layer 1) OSI reference model
The lowest layer of the OSI Reference Model is layer 1, the physical layer; it is
commonly abbreviated “PHY”. This layer deals with the actual transmission of data
using transmission media.
This layer conveys the bit stream - electrical impulse, light or radio signal --
through the network at the electrical and mechanical level. It provides the hardware
means of sending and receiving data on a carrier, including defining cables, cards and
physical aspects. Fast Ethernet, RS232, and ATM are protocols with physical layer
components.
Physical layer technologies are ones that are at the very lowest level and deal
with the actual ones and zeroes that are sent over the network. For example, when
considering network interconnection devices, the simplest ones operate at the physical
layer: repeaters, conventional hubs and transceivers. These devices have absolutely no
knowledge of the contents of a message. They just take input bits and send them as
output. Devices like switches and routers operate at higher layers and look at the data
they receive as being more than voltage or light pulses that represent one or zero.
Physical Layer Functions
The following are the main responsibilities of the physical layer in the OSI
Reference Model:
 Definition of Hardware Specifications:
The details of operation of cables, connectors, wireless radio transceivers,
network interface cards and other hardware devices are generally a function of the
physical layer.
 Encoding and Signaling:
The physical layer is responsible for various encoding and signaling
functions that transform the data from bits that reside within a computer or other
device into signals that can be sent over the network.
 Data Transmission and Reception:
After encoding the data appropriately, the physical layer actually transmits
the data, and of course, receives it. Note that this applies equally to wired and
wireless networks, even if there is no tangible cable in a wireless network!
 Topology and Physical Network Design:
The physical layer is also considered the domain of many hardware-related
network design issues, such as LAN and WAN topology.
Services Provided By Physical Layer
The services offered by the physical layer are:

 Setting up of connections:
Before data transmission can be started, a connection must be established
between the sender and receiver. The physical layer is responsible for establishing the
connection.

 Ending the connection:


After the data transmission is over, the physical; layer ends the connection.
All the resources are released and the receiver is notified that the connection has
ended.

 Transmitting data over communication channel:


Data received from upper layers is converted into appropriate electrical,
optical or electromagnetic signals and the signals are then transmitted over the
appropriate transmission medium.

 Receiving data from a communication channel:


Data received from the physical medium in the form of electrical, optical or
electromagnetic signals is converted into bits and the bits are passed onto the upper
layer.

 Unstructured bit stream:


The essential service provided by the physical layer consists of an
unstructured bit stream, which can be used by higher layers to provide the basis for
higher layer communication services.
Summery the physical layer
 Establishment and termination of a connection to a communications medium.
 Participation in the process whereby the communication resources are
effectively shared among multiple users. For example, contention resolution
and flow control.
 Modulation, or conversion between the representation of digital data in user
equipment and the corresponding signals transmitted over a communications
channel. These are signals operating over the physical cabling (such as copper
and optical fiber) or over a radio link.
 The physical layer deals with the physical characteristics of the transmiss ion
medium.
 It defines the electrical, mechanical, procedural, and functional specifications
for activating, maintaining, and deactivating the physical link between end
systems.
 Such characteristics as voltage levels, timing of voltage changes, physical data
rates, maximum transmission distances, physical connectors, and other similar
attributes are defined by physical layer specifications.
4.2.2 Data Link Layer (Layer 2)
The second-lowest layer (layer 2) in the OSI Reference Model stack is the data
link layer, often abbreviated “DLL”. The data link layer, also sometimes just called
the link layer. This layer performing the task of framing data and providing the
address of the destination computer among other tasks. The data link layer attaches
additional information known as data-link layer header and trailer, to the data to be
transmitted. The data along with the data-link layer header and trailer is known as a
frame.
The data link layer is often conceptually divided into two sublayers: logical
link control (LLC) and media access control (MAC).
The LLC Sublayer
The logical link control (LLC) sublayer is responsible for reliable transfer of
messages-called frames or, more formally, link protocol data units (LPDUs)-between
two directly-connected Layer 2 entities. Functions needed to support this reliable
transfer include framing (indicating where a Layer 2 message begins and ends),
sequence control, error control and flow control.
The error and flow control are provided by the LLC sublayer is determined by
whether the link protocol is connection-oriented or connectionless. A connectionless
link protocol provides little if any support for these functions. A connection -oriented
link might use a windowing technique for these functions, in which frames are
individually numbered and acknowledged by their sequence number, with only a few
such frames outstanding at any time.
The MAC Sublayer
The medium access control (MAC) sublayer is closely associated with the
physical layer and defines the means by which the physical channel (medium) may be
accessed. It coordinates the attempts to seize a shared channel by multiple MAC
entities. The MAC layer commonly provides a limited form of error control, especially
for any header information which defines the MAC-level destination and higher-layer
access mechanism.
Data Link Layer Functions
The following are the key tasks performed at the data link layer:

 Interfacing with the physical layer and the network layer:


The data link layer receives data from the network layer and passes it into
the physical layer for transmission. Data packets received from the network layer
are framed by adding header and trailers and passed on.
 Defining the topology of the network as bus, star, ring, tree, mesh, or a
combination:
Depending on the type of network and its desired qualities, one of the
various topologies is used.

 Logical Link Control (LLC):


Logical link control refers to the functions required for the establishment
and control of logical links between local devices on a network. This is usually
considered a DLL sublayer; it provides services to the network layer above it and
hides the rest of the details of the data link layer to allow different technologies to
work seamlessly with the higher layers.

 Media Access Control (MAC):


This refers to the procedures used by devices to control access to the
network medium. Since many networks use a shared medium (such as a single
network cable, or a series of cables that are electrically connected into a single
virtual medium) it is necessary to have rules for managing the medium to avoid
conflicts. For example. Ethernet uses the CSMA/CD method of media access
control, while Token Ring uses token passing.

 Data Framing:
The data link layer is responsible for the final encapsulation of higher-level
messages into frames that are sent over the network at the physical layer.

 Addressing:
The data link layer is the lowest layer in the OSI model that is concerned
with addressing: labeling information with a particular destination location. Each
device on a network has a unique number, usually called a hardware address or
MAC address, that is used by the data link layer protocol to ensure that data
intended for a specific machine gets to it properly.

 Error Detection and Handling:


The data link layer handles errors that occur at the lower levels of the
network stack. For example, a cyclic redundancy check (CRC) field is often
employed to allow the station receiving data to detect if it was received correctly.
Services Provided By Data Link Layer
The services offered by the data link layer are:
 Correcting errors:
The data link layer may correct the errors caused when the data is
transmitted on the physical medium. The mechanisms used for error correction are
parity bit and hamming code.
 Controlling flow of data:
The data link layer ensures that the sender sends data at a rate that the
receivers can handle. If the sender sends data at rates faster than what they receiver
can handle, the receiver start loosing data. To prevent such situations, flo w control
is used.
 Framing:
The data link layer packages the data received from the network layer as
frame and passes them onto the physical layer. Similarly, it formats the data
received from the physical layer into packets and passes them onto the netwo rk
layer.
 Controlling access to the transmission media in broadcast communication:
The data link layer ensures that all computers sharing a common channel
get a chance to send data. If there are no rules regarding who sends the data and for
how long, and a computer has to transmit large amount of data, the computer will
block the channel, thereby depriving other computers from sending or receiving
their data. The data link layer ensures that such a situation does not arise.
Summary of Data Link Layer
 The data link layer provides access to the networking media and physical
transmission across the media and this enables the data to locate its intended
destination on a network.
 The data link layer provides reliable transit of data across a physical link by
using the Media Access Control (MAC) addresses.
 The data link layer uses the MAC address to define hardware or data link
address in order for multiple stations to share the same medium and still
uniquely identify each other.
 Concerned with network topology, network access, error notification, ordered
delivery of frames, and flow control.
4.2.3 Network Layer (Layer 3)
The third-lowest layer of the OSI Reference Model is the network layer. This
layer is the heart of he OSI reference model. If the data link layer is the one that
basically defines the boundaries of what is considered a network, the network layer is
the one that defines how internetworks (interconnected networks) function. The
network layer is the lowest one in the OSI model that is concerned with actually
getting data from one computer to another even if it is on a remote network; in
contrast, the data link layer only deals with devices that are local to each other.
The network layer performs the many important tasks, such as providing
addressing information and controlling congestion. The network layer attaches
additional information known as network layer header and trailer, to the data to be
transmitted. The data along with the network layer header and trailer is known as a
packet.

Network Layer Functions


Some of the specific jobs normally performed by the network layer include:
 Controlling congestion:
When more data sent then what can be handled by network, data queues up
at routers and switches. This condition on the network is known as congestion. The
network layer provides a mechanism for controlling congestion.
 Connecting to different types of network:
Different types of networks may have different types of addressing scheme,
different maximum data length allowed and different protocols. The network layer
addresses all these issues.
 Logical Addressing:
Every device that communicates over a network has associated with it a
logical address, sometimes called a layer three address. For example, on the
Internet, the Internet Protocol (IP) is the network layer protocol and every machine
has an IP address.
 Routing:
Moving data across a series of interconnected networks is probably the
defining function of the network layer. It is the job of the devices and software
routines that function at the network layer to handle incoming packets from various
sources, determine their final destination, and then figure out where they need to
be sent to get them where they are supposed to go.
 Datagram Encapsulation:
The network layer normally encapsulates messages received from higher
layers by placing them into datagrams (also called packets) with a network layer
header.

 Fragmentation and Reassembly:


The network layer must send messages down to the data link layer for
transmission. Some data link layer technologies have limits on the length of any
message that can be sent. If the packet that the network layer wants to send is too
large, the network layer must split the packet up, send each piece to the data link
layer, and then have pieces reassembled once they arrive at the network layer on
the destination machine.
 Error Handling and Diagnostics:
Special protocols are used at the network layer to allow devices that are
logically connected, or that are trying to route traffic, to exchange informatio n
about the status of hosts on the network or the devices themselves
Services Provide By Network Layer
The services offered by network layer are:
 Routing: This layer determine the route that the data will take in moving from
the sender to receiver.
 Accounting: This layer keeps an account of the number of packets, bytes or
bits sent and received by a computer.
 Packetizing: This layer is responsible for packetizing data as a packet.
Summary of Network Layer
 Defines end-to-end delivery of packets.
 Defines logical addressing so that any endpoint can be identified.
 Defines how routing works and how routes are learned so that the packets can
be delivered.
 The network layer also defines how to fragment a packet into smaller packets
to accommodate different media.
 Routers operate at Layer 3.
4.2.4 Transport Layer (Layer 4)
The fourth and “middle” layer of the OSI Reference Model protocol stack is the
transport layer. It is more often associated with the lower layers, because it concerns
itself with the transport of data, but its functions are also somewhat high-level.
Transport layer provides different types of data transmission services, such as reliable
acknowledged service or unreliable service. It responsible for making transmission
error free for upper layer.
 Transport Layer Functions:
Let’s look at the specific functions often performed at the transport layer in
more detail:
 Interfacing with the network layer and the session layer:
The transport layer appends the data received from the session layer with
the transport layer headers and removes the headers when passing on the data,
received from network layer to the session layer.
 Providing end-to-end connectivity:
The transport layer is an end-to-end layer as compared to lower layers. The
transport layer is not aware of the existence of different networks and routes data
traverses when the data is moving from source to destination. It is also unaware of
the fact that data moves from one router to another router. Each movement from
one router to another router is called a hop.
 Spitting data:
The transport layer spits the data passed by the session layer into segments
based on the maximum size of segment that the transmitting and receiving hosts
can support.
 Controlling transmission and sequencing:
The transport layer ensures that the packet are delivered correctly,
completely and in correct order.
 Process-Level Addressing:
Addressing at layer two deals with hardware devices and layer three
addressing identifies devices on a logical internetwork. Addressing is also
performed at the transport layer, where it is used to differentiate between software
programs.
 Multiplexing and Demultiplexing:
Using the addresses transport layer protocols on a sending device multiplex
the data received from many application programs for transport, combining them
into a single stream of data to be sent. The same protocols receive data and then
demultiplex it from the incoming stream of datagrams, and direct each package of
data to the appropriate recipient application processes.
 Segmentation, Packaging and Reassembly:
The transport layer segments the large amounts of data it sends over the
network into smaller pieces on the source machine, and then reassemble them on
the destination machine. The transport layer segments messages to suit the
requirements of the underlying network layer.
 Connection Establishment, Management and Termination:
Transport layer connection-oriented protocols are responsible for the series
of communications required to establish a connection, maintain it as data is sent
over it, and then terminate the connection when it is no longer required.
 Acknowledgments and Retransmissions:
The transport layer is where many protocols are implemented that guarantee
reliable delivery of data. This is done using a variety of techniques, most
commonly the combination of acknowledgments and retransmission timers. Each
time data is sent a timer is started; if it is received, the recipient sends back an
acknowledgment to the transmitter to indicate successful transmission. If no
acknowledgment comes back before the timer expires, the data is retransmitted.
 Flow Control:
Transport layer protocols that offer reliable delivery also often implement
flow control features. These features allow one device in a communication to
specify to another that it must "throttle back" the rate at which it is sending data, to
avoid bogging down the receiver with data. These allow mismatches in speed
between sender and receiver to be detected and dealt with.
Services Provided By Transport Layer
The services offered by the transport layer are:
 Controlling errors: The transport layer ensures that the data arrives in its
entirety and correctly. This layer handles retransmission of data.
 Controlling the flow: The transport layer provides the mechanism of flow
control to prevent senders from sending more data than that receiver can
handle.
 Multiplexing: The transport layer combines multiple sessions together to send
and receives information and data.
 Types of services: The transport layer provides both connection oriented and
connection less services. Connection oriented services provide guaranteed and
in-order delivery of data where as connection less services do not guarantee
the delivery of data or the sequencing of data.
Summary of Transport Layer
 The transport layer regulates information flow to ensure end-to-end
connectivity between host applications reliably and accurately.
 The transport layer segments data from the sending host's system and
reassembles the data into a data stream on the receiving host's system.
 The boundary between the transport layer and the session layer can be thought
of as the boundary between application protocols and data-flow protocols.
Whereas the application, presentation, and session layers are concerned with
application issues, the lower four layers are concerned with data transport
issues.
 Layer 4 protocols include TCP (Transmission Control Protocol) and UDP (User
Datagram Protocol).
4.2.5 Session Layer (Layer 5)
The fifth layer in the OSI Reference Model is the session layer. The session
layer is the first one where pretty much all practical matters related to the addressing,
packaging and delivery of data are left behind—they are functions of layers four and
below. It is the lowest of the three upper layers, which collectively are concerned
mainly with software application issues and not with the details of network and
internet implementation.
As the name suggests, this layer manages session between communication
entities. This layer is not implemented separately.
Session Layer Functions
The session layer is responsible for:
 Interfacing between the transport layer and the presentation layer: The
session layer accepts data from the presentation layer and passes it onto the
transport layer while handing the state of the active session.
 Providing session management: The session layer allows two applications on
different computers to establish manage and end a session.
 Managing the information exchange between systems: The session layer
manages the information exchange between two communicating systems with
the help of various services that it provides, such as dialog management and
session management.
Services provided by Session Layer
The services offered by the session layer are:
 Authenticating the user: Authentication is verifying the user identification
details. Session layer provides user authentication service.
 Managing the dialogs: Dialog management involves deciding which
application transmits the data. The session layer controls the transmission of
data and determines the application, whose turn it is to transmit the data.
 Providing synchronization service: Synchronization refers to storing
information about the operation being performed at some defined time
intervals. This information helps in resuming operation from the saved previous
state, if the operation is interrupted. This helps in starting a broken lengthy
session from the last saved state instead of starting fresh session.
 Providing Token Management: Token management required when some
critical operations are to be performed by only one process or application. This
process having the token is allowed to perform that task. The session layer
handles the token management.
Summary of Session layer
 The session layer defines how to start, control and end conversations (called
sessions) between applications.
 This includes the control and management of multiple bi-directional messages
using dialogue control.
 It also synchronizes dialogue between two hosts' presentation layers and
manages their data exchange.
 The session layer offers provisions for efficient data transfer.
4.2.6 Presentation Layer (Layer 6)
The presentation layer is the sixth layer of the OSI Reference Model protocol
stack, and second from the top. This layer is responsible for data formatting and
presenting data for display. It deals with the presentation of data. More specifically,
the presentation layer is charged with taking care of any issues that might arise where
data sent from one system needs to be viewed in a different way by the other system.
Presentation Layer functions
The presentation layer responsible for:

 Interfacing between the session layer and the application layer: This layer
accept data from the application layer and after suitable operations, such as
data transformation, passes it onto the session layer.

 Presenting data for display after formatting: The presentation layer formats
the data appropriately for display on a display device.

 Converting data from one representation to some standard form of


representation: This layer is responsible for converting data from one format
to another. The presentation layer transforms data from a computer specific
representation to a standard representation, and then transmit the data. After
receiving receipt of converted data, it convert the data back to a computer
specific representation.
Services Provided by Presentation Layer
The services offered by presentation layer are:

 Encrypting data: Data is encrypted for security in transmission. Encryption is


a process of converting data to a format that cannot be understood. Decryption
is the process of converting the encrypted data back to its original form.

 Compressing data: Data is compressed to reduce its size during transmission.


Data is compressed prior to transmission and decompressed after the
presentation layer receives it.
Summary of Presentation layer
 The presentation layer ensures that the information that the application layer of
one system sends out is readable by the application layer of another system.
 If necessary, the presentation layer translates between multiple data formats by
using a common format.
 Provides encryption and compression of data.
4.2.7Application Layer (Layer 7)
The application layer is the seventh and top most layer in the OSI reference
model. This layer interacts with user. The application layer interfaces directly to and
performs common application services for the application processes; it also issues
requests to the presentation layer.
This layer provides services to user-defined application processes, and not to
the end user. For example, it defines a file transfer protocol, but the end user must go
through an application process to invoke file transfer. The OSI model does not include
human interfaces. The common application services sublayer provides functional
elements including the Remote Operations Service Element (comparable to Internet
Remote Procedure Call), Association Control, and Transaction Processing.
Application Layer Functions
The application layer responsible for:
 Interfacing between with the presentation layer and user: The application
layer accepts input from the user and presents output. The output is passed onto
the subsequent layer for processing.
 Defining how an application on one computer can communicate with
application on other computers: The application layer provides a mechanism
for an application to communicate with other application on different
computers.

Services provides by Application Layer


 Network abstraction: The application layer provides an abstraction of the
underlying network to an end user and an application.

 File access and transfer: It allows a user to access, download or upload file
from/to a remote host.

 Mail services: It allows the user to use the mail services.

 Remote login: It allows logging into a host which is remote.

 World Wide Web (WWW): Accessing the Web pages is also a part of this
layer.

Summery of Application layer


 The application layer is the OSI layer that is closest to the user.

 It provides network services to the user’s applications.

 It differs from the other layers in that it does not provide services to any other
OSI layer, but rather, only to applications outside the OSI model.

 Examples of such applications are spreadsheet programs, word processing


programs, and bank terminal programs.

 The application layer establishes the availability of intended communication


partners, synchronizes and establishes agreement on procedures for error
recovery and control of data integrity.

4.2.8 Interlayer Communication


An internetwork is a network of networks, composed of terminals, switches and
communication media. The overall objective of an internetwork is to allow
communication between two (or more) networks. This simple description hides the
complications that arise in real networks, in which the types of medium vary,
transmission errors occur, transmission links fail, switches fail or become congested,
equipment is produced by different manufacturers, networks are owned and
maintained by different organisations, and so on
In large internetworks, communication between systems is a complicated
process, and to cope with this complexity the hardware and software in the systems are
organised as a hierarchy of layers. Each layer performs some of the functions
necessary to achieve communication between systems. The layers, particularly higher
layers, are mostly implemented as software components of communication networks.
It is very important to appreciate the hierarchical nature of communication systems:
each layer, except the lowest, is built upon the layer below.
A service normally requires some communication between systems in a
communication network, and the set of rules which govern the communication is
called a protocol. These rules are expressed in terms of the format of messages
exchanged between two systems (the syntax), and the way in which the messages
should be interpreted (the semantics). In this context, a protocol determines how
communication takes place between the same layers in different systems, that is,
between peer layers, and for this reason you may see this type of communication
referred to as peer-to-peer. The peer layers exchange data as though there is a direct
link between the two (as shown in Figure 4.3), but in reality all the data is passed
down through all the layers and is carried by the physical media in the form of signals.
However, it is convenient to imagine that there is a direct virtual connection and
ignore all lower layers.
End system A End system B

Application Application

Application Layer Application Layer

Presentation Layer Presentation Layer


Upper Layer

Session Layer Session Layer

Transport Layer Transport Layer


Intermediate system

Netwo Netwo
Network Layer Network Layer
Intermediate system rk rk Intermediate system
Lower Layer

layer layer
Data Data Data Data Data Data
Data link Layer Link Link Link Link Link Link Data link Layer
layer layer layer layer layer layer
Data Data Data Data Data Data
Link Link Link Link Link Link
Physical Layer Physical Layer
layer layer layer layer layer layer
Physical Physical Physical Physical
medium medium medium medium

Figure 4.2 Interlayer communication of OSI model.

Before going into more detail about Figure 4.3 shall describe very briefly the
main functions of each of the seven layers:
1. Physical layer – provides the mechanical, electrical and procedural means for
transmitting bits over a communication medium.
2. Data link layer – provides services for the transmission of data between directly
connected systems in a communication network.
3. Network layer – handles the routing of data through communication networks.
4. Transport layer – provides reliable end-to-end services without being
concerned about the route through communication networks.
5. Session layer – provides facilities to organise and synchronise dialogues, i.e.
communications that consist of several strands such as audio and video
components.
6. Presentation layer – deals with issues about how data is represented and
ensures that the systems agree on how the information is transferred.
7. Application layer – provides the means for application programs to access the
communication system represented by the OSI reference model. For instance,
the application layer can provide services for supporting file transfer and email.
The lowest three layers are primarily concerned with the problems of
transferring data across physical networks, and the highest four layers are associated
with end-to-end issues and not the specific details of any communication network.
Intermediate systems in Figure 4.3 are shown as pairs of stacks of layers. Diffe rent
conditions may be encountered on the two sides of an intermediate system: for
instance, different transmission media may link two systems together.
4.2.9 Data Encapsulation
Data Encapsulation is a process of taking one Protocol Data Unit (PDU) and
enveloping it within a set of protocol header and trailer. In the OSI 7 layers model,
each layer is primarily responsible for communicating with a peer layer on another
machine. This communication between peers is done in "Protocol Data Units" (PDU),
which consists of this layer's Header, Trailer and Data encapsulated.
Each layer may add a Header and a Trailer to its PDU as it proceeds through
the layers. The Headers contain information that specifically addresses layer-to-layer
communication. Headers, trailers and data are relative concepts, depending on the
layer that analyzes the information unit. For example, the Transport Header (TH)
contains information that only the Transport layer sees. All other layers below the
Transport layer pass the Transport Header as part of their Data. At the network layer,
an information unit consists of a Layer 3 header (NH) and data. At the data link layer,
however, all the information passed down by the network layer (the Layer 3 header
and the data) is treated as data. In other words, the data portion of an information unit
at a given OSI layer potentially can contain headers, trailers, and data from all the
higher layers.
For example, if computer A has data from a software application to send to
computer B, the data is passed to the application layer. The application layer in
computer A then communicates any control information required by the application
layer in computer B by prepending a header to the data. The resulting message unit,
which includes a header, the data and maybe a trailer, is passed to the presentation
layer, which prepends its own header containing control information intended for the
presentation layer in computer B. The message unit grows in size as each layer
prepends its own header and trailer containing control information to be used by its
peer layer in computer B. At the physical layer, the entire information unit is
transmitted through the network medium.
The physical layer in computer B receives the information unit and passes it to
the data link layer. The data link layer in computer B then reads the control
information contained in the header prepended by the data link layer in computer A.
The header and the trailer are then removed, and the remainder of the information unit
is passed to the network layer. Each layer performs the same actions: The layer reads
the header and trailer from its peer layer, strips it off, and passes the remaining
information unit to the next higher layer. After the application layer performs these
actions, the data is passed to the recipient software application in computer B, in
exactly the form in which it was transmitted by the application in computer A. See in
Figure 4.4.
Computer A Computer B

7 L8H Data 7

6 L6H L8H Data 6

5 L5H L6H L8H Data 5

4 L4H L5H L6H L8H Data 4

3 L3H L4H L5H L6H L8H Data 3

2 L2H L3H L4H L5H L6H L8H Data L2F 2

1 1 00 1 0 11 0 11 00 1 0 11 1

Figure 4.9 Data encapsulation in OSI reference model.


4.2.10 Communication Models
The OSI Reference Model incorporates two communications models:
1. A horizontal communication: It is protocol-based model by which
programs or processes on different machines communicate.
2 A vertical communication: It is service-based model by which layers
on a single machine communicate.
4.2.10.1 Horizontal communication
Let's consider how these corresponding layers communicate using protocols.
First, recall that every layer in the model, except the bottom (physical) layer, is really
a program or algorithm running on a computer. There is no way for, say, a Web
browser and a Web server to actually connect together directly—they are just software
programs, after all. Instead, the software running at various layers communicates
logically. That is to say, through the use of software and procedures, a process running
at layer 5 on one machine can accomplish logical communication with a similar
process running at layer 5 on another machine.
Since machines are only physically connected at layer 1, this means that in
order for a protocol at layer 5 to function, the data on the sending machine must “pass
down” the data through the layers between layer 5 and layer 1. The data is then
transmitted over the physical connection to layer 1 of the other machine, and “passed
up” the protocol stack of the receiving machine to layer 5. This is how the two
machines are logically linked at layer 5, even though they have no physical connection
at that layer.
Thus, with the exception of the actual physical connection at layer 1, all
horizontal communication also requires vertical communication—down the stack on
one machine, and then back up the stack on the other. This process is illustrated in
Figure 4.5
7 Application Layer 7 Protocol Application 7
Layer 6/7 Interface Layer 6/7 Interface

6 Presentation Layer 6 Protocol Presentation 6


Layer 5/7 Interface Layer 5/7 Interface

5 Session Layer 5 Protocol Session 5


Layer 4/7 Interface Layer 4/7 Interface

4 Transport Layer 4 Protocol Transport 4


Layer 3/7 Interface Layer 3/7 Interface

3 Network Layer 3 Protocol Network 3


Layer 2/7 Interface Layer 2/7 Interface

2 Data Link Layer 2 Protocol Data Link 2


Layer 1/7 Interface Layer 1/7 Interface

1 Physical Layer 1 Protocol Physical 1

Figure 4.2.10 Horozontal communication in OSI reference model.

4.2.10.2 Vertical Communication


The seven layers of the OSI Reference Model are used to split up the various
functions that are required to implement a networking system. On any given device in
a network, different software and hardware routines and devices may be functioning
on any or all of these layers simultaneously. Since in general, all of these are supposed
to be working together to implement networking functions, there is a need for layers to
communicate vertically between the layers within a particular host.
In OSI Reference Model parlance, the mechanism for communication between
adjacent layers in the model is called an interface. Of course, the term “interface” is
also used widely in other contexts in the computer and networking worlds, since its
generic meaning refers to connecting just about anything together. However, when
someone talks about an interface between OSI model layers, that person typically
refers to the process by which data is passed between layer N of the model and layer
N-1 or layer N+1.
These relationships are demonstrated in Figure 4.6 . For example, the layer 2/3
interface is used by a layer two and layer three protocol to pass data and control
information; the layer 3/4 interface connects layers 3 and 4 together.

7 Application

Layer 6/7 Interface


6 Presentation

Layer 5/7 Interface


5 Session

Layer 4/7 Interface


4 Transport

Layer 3/7 Interface


3 Network

Layer 2/7 Interface


2 Data Link

Layer 1/7 Interface


1 Physical

Figure 4.2.10.1 Vertical communication in OSI reference model.

Vertical communication is done up and down the protocol stack every time
anything is sent across the network, and of course, whenever anything is received.
This occurs because the higher levels are implemented as logical functions, in
software; there is no actual physical connection. The higher layers package data and
send it down to the lower layers for it to be sent across the network. At the very lowest
level, the data is sent over the network. On the receiving end, the process is reversed,
with the data traveling back up to the higher layers on the receiving device.
4.2.10.3 Communication Elements:
In order to communicate, the following elements are needed:
 At least two parties wishing to communicate. These can be the same or
different programs on each machine, or they can be two layers on the same
machine.
 A common language, or protocol, with which these parties can communicate.
Horizontally (that is, between machines) the two programs need a common
protocol or an interpreter to translate for each program. Vertically, layers
communicate through APIs (Application Program Interfaces). The APIs define
the available functions for a layer and provide the mechanisms for invoking
these functions.
4.2.11 Data Transmission in the OSI Model
Figure 4.7 shows an example of how data can be transmitted using the OSI
model. Figure 4.7 shows how actual data transmission occurs in OSI model.
Sending
Process Receiving
Process
Data

Application Data Application


AH
Layer Layer
Presentation Presentation
PH Data
Layer Layer
Session Session
SH Data
Layer Layer
Transport Transport
Layer TH Data Layer
Network Network
Layer NH Data Layer
Data Link Data Link
NH Data DT
Layer Layer
Physical Bits Physical
Layer Layer

Actual Data Transmission Path


Figure 4.11 shows how actual data transmission occurs in OSI model.
The sending process has some data it wants to send to the receiving process. It
gives data to the application layer, which then attaches the application header, AH to
the front of it and passes to the presentation layer.
The presentation layer may transform this item in various ways and add a
header, PH to the front of it and passes to the session layer.
When the request reaches the transport layer, the transport layer protocol adds
its own header to the request. The header consists of fields containing information that
is specific to the functions of that protocol, and the original request becomes the data
field, or payload, for the transport layer protocol.
The transport layer protocol, after adding its header, passes the request down to
the network layer. The network layer protocol then adds its own header in front of the
transport layer protocol's header. The original request and the transport layer protocol
header thus become the payload for the network layer protocol. This entire construct
then becomes the payload for the data-link layer protocol, which typically adds both a
header and footer.
The final product, a packet, is then ready for transmission over the network.
After the packet reaches its destination or receiving process, the entire process is
repeated in reverse. The protocol at each successive layer of the stack (traveling
upward this time) processes and removes the header applied by its equivalent protocol
in the transmitting system. When the process is complete, the original request arrives
at the application layer of receiving process for which it was destined in the same
condition as when it was generated.
This process also called data encapsulation terminology. The procedure is
functionally similar to the process of preparing a letter for mailing. The application
request is the letter itself, and the protocol headers represent the process of putting the
letter into an envelope, addressing it, stamping it, and mailing it.
4.2.12 OSI Reference Model Layer Summary
Data Type
Layer Name Key Responsibilities Scope
Handled
Encoding and Signaling; Electrical or light
Physical Data Transmission; signals sent
Physical Bits
Hardware Specifications; between local
Topology and Design devices
Logical Link Control; Media
Access Control; Data Framing;
Low-level data
Addressing; Error Detection
Data Link Frames messages between
and Handling; Defining
local devices
Requirements of Physical
Layer
Logical Addressing; Routing;
Datagram Encapsulation; Messages
Datagrams /
Network Fragmentation and between local or
Packets
Reassembly; Error Handling remote devices
and Diagnostics
Process-Level Addressing;
Multiplexing/De multiplexing;
Connections; Segmentation Communication
Datagrams /
Transport and Reassembly; between software
Segments
Acknowledgments and processes
Retransmissions;
Flow Control
Sessions between
Session Establishment,
Session Sessions local or remote
Management and Termination
devices
Data Translation; Compression Encoded User Application data
Presentation
and Encryption Data representations
Application User Application Services User Data Application data
4.3 TCP/IP Reference Model:
The TCP/IP model or Internet reference model, sometimes called the DoD
model (DoD, Department of Defense), ARPANET reference model, is a layered
abstract description for communications and computer network protocol design. It was
created in the 1970s by DARPA for use in developing the Internet's protocols.
Layers of the TCP/IP model
The TCP/IP reference model consists of the following four layers:
 Link layer
 Internet
 Transport
 Application
Figure 4.8 The seven-layer OSI reference model versus the four TCP/IP
reference model

OSI TCP/IP
Application
Presentation Application
Session
Transport Transport

Network Internet
Data Link Link
Physical

Figure 4.3 OSI and TCP/IP model layers.


4.3.1 Link Layer
This is the lowest layer in the TCP/IP protocol stack. This layer comprises
device drivers and network hardware. This layer does not have any standard set of
protocols and standards.
The functions preformed by this layer are:
 Interfacing with network layer:
The internet layer adds the link layer header to the internet layer data to
frame the data. Similarly, when data is received from the physical medium, the link
layer removes the link layer headers and passes the data to the internet layer.
 Interfacing with the device driver and network hardware:
Different types of hardware exits for different types of networks. Different
device drivers written for different NICs. Link layer takes data from the internet
layer, based on the device driver in use, passes it to the appropriate NIC.
4.3.2 Internet Layer
The internet layer is exactly equivalent to the network layer of the OSI model.
IP is the primary protocol operating at this layer, and it provides data encapsulation,
routing, addressing, and fragmentation services to the protocols at the transport layer
above it. Two additional protocols, called the Internet Control Message Protocol
(ICMP) and the Internet Group Message Protocol (IGMP), also operate at this layer, as
do some of the specialized dynamic routing protocols.
The functions performed by this layer are:
 Routing:
Routing is the process of moving data on a network such the data reaches its
destination. Routing consists of two activities, determining path to destination and
actual data transfer.
 Fragmentation and reassembly:
Every network has an upper limit on the size of the packet that can be sent.
This limit is known as the maximum transfer unit (MTU). If the data to be sent is
of a size greater than the MTU, the internet layer breaks the data into smaller
packets. This process known as fragmentation. Additional information, such as the
sequence number of the fragment, is added to the fragmented packet. When
internet layer receives the fragments, it reassembles them into complete data before
passing it into transport layer.
4.3.3 Transport Layer
Transport layer is a true end-to-end layer. The transport layer is equivalent to
the layer of the same name in the OSI model. The TCP/IP suite includes two protocols
at this layer, the Transmission Control Protocol (TCP) and the User Datagram Protocol
(UDP), which provide connection-oriented and connectionless data transfer services,
respectively.
TCP provides reliable, full-duplex connections and reliable service by ensuring
that data is resubmitted when transmission results in an error (end-to-end error
detection and correction). Also, TCP enables hosts to maintain multiple, simultaneous
connections. When error correction is not required, UDP provides unreliable datagram
service (connectionless) that enhances network throughput at the host-to-host transport
layer.
Both protocols deliver data between the application layer and the internet layer.
Applications programmers can choose the service that is most appropriate for their
specific applications.
The functions of the transport layer are:
 Providing connection-oriented reliable service:
IP provides an unreliable service. This means that the data may be lost or
may arrive in an order different from the order in which the data was sent. TCP
uses IP as internet layer. IP does not take care of ordering and reliability.
Therefore, TCP has to take care of reliability and ordering issues. TCP provides a
connection-oriented and reliable service.
 Providing connectionless unreliable service:
UDP provides connectionless unreliable service. UDP uses IP in the same
way as TCP. However, UDP does not provide reliable error-free service. UDP has
lesser overhead than TCP because of unreliability. When speed is important, then
UDP is useful.
 Providing Flow control:
TCP has flow-control capabilities. The transport layer provides the
mechanism of flow control to prevent sender from sending more data than what
receivers can handle. Transport layer uses stop and wait and sliding window
protocols, to achieve flow control.
 Providing error control:
TCP implements error handing, which means that lost or corrupt data is
retransmitted until correct is received. To achieve this, the receiver sends an
acknowledgement to the sender for all received data. If the acknowledgement does
not reach the sender, it retries sending data again. If, even after making a certain
specified number of retries, the acknowledgement does not arrive, the sender stops
transmission and informs the upper layer, which is the application layer, about the
failure to transmit the data.
4.3.4 Application Layer
The application layer is used by most programs for network communication.
Data is passed from the program in an application-specific format, and then
encapsulated into a transport layer protocol.
This is layer user interacts with network. Some of the most common
applications are e-mail, FTP, Telnet, and Web browsers.
The most widely known and implemented TCP/IP application layer protocols are:
 File Transfer Protocol (FTP). Performs basic interactive file transfers
between hosts.
 Telnet. Enables users to execute terminal sessions with remote hosts.
 Simple Mail Transfer Protocol (SMTP). Supports basic message delivery
services.
 HyperText Transfer Protocol (HTTP). Supports the low-overhead transport
of files consisting of a mixture of text and graphics. It uses a stateless,
connection- and object-oriented protocol with simple commands that support
selection and transport of objects between the client and the server.
In addition to widely known protocols, the application layer includes the
following protocols:
 Domain Name Service (DNS). Also called name service; this application maps
IP addresses to the names assigned to network devices.
 Routing Information Protocol (RIP). Routing is central to the way TCP/IP
works. RIP is used by network devices to exchange routing information.
 Simple Network Management Protocol (SNMP). A protocol that is used to
collect management information from network devices.
 Network File System (NFS). A system developed by Sun Microsystems that
enables computers to mount drives on remote hosts and operate them as if they
were local drives.
4.3.3 Comparison of OSI and TCP/IP reference models
OSI Reference Model TCP/IP Reference Model
The OSI reference model has seven The TCP/IP reference model has only
layers. four layers.
There are the physical, session, and There are no the physical, session, and
presentation layers. presentation layers.
The OSI reference model is not used Where as TCP/IP is the model used by
practically. maximum networks.
The OSI reference model was The TCP/IP reference model was
developed first, and although it has developed after TCP/IP implemented.
no practical implementations, the Therefore, the TCP/IP reference model
separation of the link and physical lacks the clear separation of tasks in
layer is very clear. the link layer.
The OSI reference model supports The TCP/IP model has only one mode
both connectionless and connection in the network layer (connectionless)
oriented communication in the but supports both modes in the
network layer, but only connection transport layer.
oriented communication in transport
layer.
The OSI reference model clearly Where as TCP/IP model did not clearly
distinguishes between service, distinguish between service, interface
interface and protocols. and protocols.
The OSI reference model designed In TCP/IP reference model protocols
first, and then protocols are invented. are identified first and according five
layers model designed.

4.5 Addressing:
Four levels of addresses are used in an internet employing the TCP/IP protocols:
physical address, logical address, port address, and application-specific address.
Each address is related to a one layer in the TCP/IP architecture, as shown in the
following Figure 4.5.

Figure 4.5 Addresses are used in the TCP/IP protocol


4.5.1 Physical Addresses:
The physical address, also known as the link address, is the address of a node as
defined by its LAN or WAN. It is included in the frame used by the data link layer.
It is the lowest-level address.
The size and format of these addresses vary depending on the network. For
example, Ethernet uses a 6-byte (48-bit) physical address that is imprinted on the
network interface card (NIC).
Most local area networks use a 48-bit (6-byte) physical address written as 12
hexadecimal digits; every byte (2 hexadecimal digits) is separated by a colon, as
shown below.

4.5.2 Logical Addresses:


Logical addresses are necessary for universal communications that are independent
of underlying physical networks. Physical addresses are not adequate in an
internetwork environment where different networks can have different address
formats. A universal addressing system is needed in which each host can be
identified uniquely, regardless of the underlying physical network.
The logical addresses are designed for this purpose. A logical address in the
Internet is currently a 32-bit address that can uniquely define a host connected to
the Internet. An internet address in IPv4 in decimal numbers 192.168.10.16 No two
publicly addressed and visible hosts on the Internet can have the same IP address.
The physical addresses will change from hop to hop, but the logical addresses
remain the same.
Unicast, Multicast, and Broadcast Addresses:
The logical addresses can be either unicast (one single recipient), multicast (a
group of recipients), or broadcast (all systems in the network). There are
limitations on broadcast addresses.
4.5.3 Port Addresses:
The IP address and the physical address are necessary for a quantity of data to
travel from a source to the destination host. However, arrival at the destination
host is not the final objective of data communications on the Internet. Computers
are devices that can run multiple processes at the same time. The end objective of
Internet communication is a process communicating with another process.
For example, computer A can communicate with computer C by using TELNET. At
the same time, computer A communicates with computer B by using the File
Transfer Protocol (FTP). For these processes to receive data simultaneously, we
need a method to label the different processes. In other words, they need addresses. In
the TCP/IP architecture, the label assigned to a process is called a port address. A
port address in TCP/IP is 16 bits in length. A port address is a 16-bit address
represented by one decimal number as shown.

Application-Specific Addresses:
Some applications have user-friendly addresses that are designed for that specific
application.
Examples include the e-mail address (for example, co_sci@yahoo.com) and the
Universal Resource Locator (URL) (for example, www.mhhe.com). The first
defines the recipient of an e-mail; the second is used to find a document on the
World Wide Web.

4.4 Protocols.
4.4.1 Host to Network Layer-SLIP, PPP
SLIP (Serial Line Interface Protocol)
Serial Line IP (SLIP) is used for point-to-point serial connections running TCP/IP.
SLIP is commonly used on dedicated serial links and sometimes for dialup purposes,
and is usually used with line speeds between 1200 bps and 19.2 Kbps. SLIP is useful
for allowing mixes of hosts and routers to communicate with one another (host-host,
host-router and router-router are all common SLIP network configurations).
SLIP Data Format:

Data: The actual IP packet being transmitted over the serial link.
End Flag: A special END character (0xC0 in hexadecimal) that marks the end of a
SLIP frame.
Problems with SLIP (Serial Line Internet Protocol)
1. No Error Detection or Correction – SLIP does not include checksums or
CRC, making it prone to data corruption.
2. Supports Only IP Packets – Cannot transmit other protocols like ARP, ICMP,
or IPv6.
3. Inefficient Framing – Uses a single END (0xC0) character for packet
termination, requiring byte stuffing.
4. No Addressing Mechanism – Assumes a direct point-to-point link, making it
unsuitable for multi-device networks.
5. No Authentication or Security – Lacks authentication methods like PAP or
CHAP, making it vulnerable to unauthorized access.
6. No Compression – Does not reduce packet size, leading to inefficient
bandwidth usage.
7. Vulnerable to Noisy Environments – Serial connections often experience
errors, and SLIP has no built-in error recovery.
8. No Multiplexing – Cannot differentiate between multiple data streams like
PPP can.
9. Manual Configuration Required – Lacks automatic configuration options,
making setup complex.
10. Obsolete – SLIP has been replaced by PPP, which offers better features like
error checking, compression, and multi-protocol support.
PPP (Point-to-Point Protocol)
The Point-to-Point Protocol (PPP) suite provides a standard method for transporting
multi-protocol datagrams over point-to-point links. PPP was originally
devised as an encapsulation protocol for transporting IP traffic between two peers. It is
a data link layer protocol (layer 2 in the OSI model) in the TCP-IP protocol suite over
synchronous modem links, as a replacement for the non-standard layer2 protocol
SLIP. However, other protocols other than IP can also be carried over PPP, including
DEC net and Novell’s Internetwork Packet Exchange (IPX).

PPP (Point-to-Point Protocol) Frame Format:

Flag: indicates the beginning or end of a frame, consists of the binary sequence 01111110.
Address: contains the binary sequence 11111111, the standard broadcast address. (Note:
PPP does not assign individual station addresses.)
Control: contains the binary sequence 00000011, which calls for transmission of user data
in an un sequenced frame.
Protocol: identifies the protocol encapsulated in the information field of the frame.
Information: zero or more octet(s) contains the datagram for the protocol specified in the
protocol field.
FCS: Frame Check Sequence (FCS) Field, normally 16 bits. By prior agreement,
consenting PPP implementations can use a 32-bit FCS for improved error detection.

PPP (Point-to-Point Protocol) connection process:


PPP (Point-to-Point Protocol) connection process between a Client and Server. The
diagram is organized into five distinct phases:
Phase 1: Link Establishment
 Client sends LCP Configure Request to Server
 Server responds with LCP Configure Ack
 Server sends LCP Configure Request to Client
 Client responds with LCP Configure Ack
Phase 2: Authentication (optional)
 Client sends Authentication Protocol (PAP/CHAP) to Server
 Server sends Authentication Response to Client
Phase 3: Network Layer Protocol Configuration
 Client sends IPCP Configure Request to Server
 Server responds with IPCP Configure Ack/Nak/Reject
 If Nak received, Client sends another IPCP Configure Request
 Server responds with IPCP Configure Ack
Phase 4: Network Layer Protocol Operation
 Bidirectional IP Data Transfer between Client and Server

Termination
 Client sends LCP Terminate Request to Server
 Server responds with LCP Terminate Ack
4.4.2 Internet Layer-IP, ARP, RARP, ICMP
4.4.2.1 Address Mapping:
An internet is made of a combination of physical networks connected by
internetworking devices such as routers. A packet starting from a source host may
pass through several different physical networks before finally reaching the
destination host. The hosts and routers are recognized at the network level by their
logical (IP) addresses, while at the physical level, they are recognized by their
physical (MAC) addresses. Thus delivery of a packet to a host or a router requires
two levels of addressing: logical (IP) and physical (MAC).
We need to be able to map a logical address to its corresponding physical address and
vice versa. These can be done by using either static or dynamic mapping.
Static mapping
Static mapping involves in the creation of a table that associates a logical address
with a physical address. This table is stored in each machine on the network. Each
machine that knows, for example, the IP address of another machine but not its
physical address can look it up in the table. Static mapping has some limitations
because physical addresses may change in the following ways:

o A machine could change its NIC (Network Interface Card), resulting in a new
physical address.
o In some LANs, such as Local Talk, the physical address changes every time the
computer is turned on.
o A mobile computer can move from one physical network to another, resulting
in a change in its physical address.
To implement these changes, a static mapping table must be updated periodically. This
overhead could affect network performance.

Dynamic mapping
In such mapping each time a machine knows one of the two addresses (logical or
physical), it can use a protocol to find the other one.
Mapping Logical to Physical Address: ARP
ARP stands for Address Resolution Protocol which is one of the most important
protocols of the Network layer in the OSI model. ARP finds the physical address,
also known as Media Access Control (MAC) address, of a host from its known IP address
Figure 4.2.2

Figure 4.2.2 . ARP Mapping


Figure 4.2.2 ARP operation

Following steps are involved in logical to physical address mapping:


1. The host or the router sends an ARP query packet. The ARP query packet
includes the physical and IP addresses of the sender and the IP address of the
receiver. As the sender does not know the physical address of the receiver, the
ARP query is broadcast over the network (see Figure 11).
2. Every host or router on the network receives and processes the ARP query packet,
but only the intended recipient recognizes its IP address and sends back an ARP
response packet.
3. The ARP response packet contains the recipient's IP and physical addresses. The
ARP response packet is unicast directly to the inquirer (host/router) by using the
physical address received in the query packet
ARP Packet Format:

Figure 4.2.4: ARP packet


The fields are as follows:
 Hardware type: This is a 16-bit field defining the type of the network on
which ARP is running. Each LAN has been assigned an integer based on its
type. For example, Ethernet is given type 1. ARP can be used on any physical
network.
 Protocol type: This is a 16-bit field defining the protocol. For example, the
value of this field for the IPv4 protocol is 080016, ARP can be used with any
higher-level protocol.
 Hardware length: This is an 8-bit field defining the length of the physical address
in bytes. For example, for Ethernet the value is 6
 Protocol length: This is an 8-bit field defining the length of the logical
address in bytes. For example, for the IPv4 protocol the value is 4.
 Operation: This is a 16-bit field defining the type of packet. Two packet types
are defined: ARP request (1) and ARP reply (2).
 Sender hardware address: This is a variable-length field defining the
physical address of the sender. For example, for Ethernet this field is 6 bytes
long.
 Sender protocol address: This is a variable-length field defining the logical
(for example, IP) address of the sender. For the IP protocol, this field is 4
bytes long.
 Target hardware address: This is a variable-length field defining the
physical address of the target. For example, for Ethernet this field is 6 bytes
long. For an ARP request message, this field is all 0s because the sender does
not know the physical address of the target.
 Target protocol address: This is a variable-length field defining the logical
(for example, IP) address of the target. For the IPv4 protocol, this field is 4
bytes long.
4.4.2.2 Mapping Physical to Logical Address: RARP,
There are occasions in which a host knows its physical address, but needs to know
its logical address Figure 4.2.4.
This may happen in two cases:
Case 1: A diskless station is just booted. The station can find its physical address
by checking its interface, but it does not know its IP address.
Case 2: An organization does not have enough IP addresses to assign to each
station; it needs to assign IP addresses on demand. The station can send its physical
address and ask for a short time lease.
Figure 4.4.5. RARP Mapping

RARP:
Reverse Address Resolution Protocol (RARP) finds the logical address for a
machine that knows only its physical address. To create an IP datagram, a host or a
router needs to know its own IP address or addresses. The IP address of a machine
is usually read from its configuration file stored on a disk file. However, a diskless
machine is usually booted from ROM, which has minimum booting information.
The ROM is installed by the manufacturer. It cannot include the IP address
because the IP addresses on a network are assigned by the network administrator.
The machine can get its physical address (by reading its NIC, for example), which
is unique locally. It can then use the physical address to get the logical address by
using the RARP protocol.
RARP Operation:
RARP operation is displayed in Figure 14.
 A RARP request is created and broadcast on the local network.
 Another machine on the local network that knows all the IP addresses will
respond with a RARP reply.
 The requesting machine must be running a RARP client program; the responding
machine must be running a RARP server program.
Figure 14.2.6: RARP Operation
Limitations of RARP:
 As broadcasting is done at the data link layer. The physical broadcast address,
all 1’s in the case of Ethernet, does not pass the boundaries of a network.
 This means that if an administrator has several networks or several subnets, it
needs to assign a RARP server for each network or subnet.
 This is the reason that RARP is almost obsolete.
 Two protocols, BOOTP and DHCP, are replacing RARP.
4.4.2.3 Internet Control Message Protocol (ICMP):
ICMP (Internet Control Message Protocol) is a network layer protocol used for
diagnostic and control purposes in IP networks. It's an essential component of the
TCP/IP suite that helps network devices communicate error messages and
operational information.
The Internet Protocol (IP) rules say that any device using IP must also use ICMP
(defined in RFC 792). ICMP helps routers and other computers send messages to your
computer. It mainly tells you when something goes wrong with your internet connection.
For example,
ICMP sends messages when:
 Your data can't reach where it's supposed to go
 A router doesn't have enough space to handle your data
 A router knows a faster way to send your data
Most of the time, an ICMP message is sent back to you because of data you sent out.
This message might come from a router somewhere between you and your destination, or
from the destination computer itself.
ICMP message format:

 Type (8 bits):

 Identifies the ICMP message type


 Common types include:
o 0: Echo Reply (ping response)
o 3: Destination Unreachable
o 5: Redirect
o 8: Echo Request (ping)
o 11: Time Exceeded (TTL expired)

 Code (8 bits):

 Further qualifies the ICMP message type


 Provides more specific information about the error or condition
 For example, Type 3 (Destination Unreachable) has different codes:
o Code 0: Network Unreachable
o Code 1: Host Unreachable
o Code 3: Port Unreachable

 Checksum (16 bits):

 Used to detect errors in the ICMP message


 Calculated over the entire ICMP message

 Rest of the Header (32 bits):

 Content varies depending on the Type and Code


 For Echo Request/Reply: Contains Identifier and Sequence Number
 For Destination Unreachable: Contains unused bits and Next-hop MTU
 For Redirect: Contains Gateway Internet Address

 Data Section (Variable length):

 For error messages: Contains the IP header and first 8 bytes of the original
datagram that caused the error
 For Echo Request/Reply: Contains the optional data sent with the ping.

4.4.3 Transport Layer-TCP and UDP


4.4.3.1 TCP (Transmission Control Protocol):
TCP (Transmission Control Protocol), is a reliable connection-oriented protocol that
allows a byte stream originating on one machine to be delivered without error on any
other machine in the internet. It fragments the incoming byte stream into discrete
messages and passes each one on to the internet layer. At the destination, the receiving
TCP process reassembles the received messages into the output stream. TCP also
handles flow control to make sure a fast sender cannot swamp a slow receiver with
more messages than it can handle.

TCP header format:


Figure 4.4.3.1. The TCP header.

Size
Field Name Description
(Bits)
Source Port 16 Identifies the sender’s port number.

Destination Port 16 Identifies the recipient’s port number.


The sequence number of the first byte of data in this
Sequence Number 32
segment.
If the ACK flag is set, this contains the next
Acknowledgment
32 expected
Number
sequence number from the other side.
Data Offset Indicates the TCP header length in 32-bit words
4
(Header Length) (helps locate the data start point).
Reserved 3 Reserved for future use (must be set to 0).
Control Flags (9 These bits control the connection states (SYN, ACK,
9
bits) FIN, etc.).
Specifies the amount of data (in bytes) the sender
Window Size 16
can receive before acknowledgment.
Checksum 16 Ensures the integrity of the TCP segment.

Urgent Pointer 16 If URG is set, this field points to urgent data.


Contains optional parameters like
Options Variable Maximum Segment Size (MSS), timestamps,
or Selective Acknowledgment (SACK).
Ensures the header is a multiple of 32 bits by
Padding Variable
adding extra zeroes.
Data (Payload) Variable The actual application data being transmitted.

Control Flags (9 Bits):

Each flag has a specific function in connection management and data transfer:
Flag Meaning
CWR (Congestion Window Reduced) Used for congestion control.
Signals congestion notification when ECN is
ECE (ECN-Echo)
enabled.
URG (Urgent) Indicates urgent data is being sent.
ACK (Acknowledgment) Acknowledges receipt of data.
PSH (Push) Forces immediate data delivery.
RST (Reset) Resets the connection.
Used in connection establishment (TCP 3-way
SYN (Synchronize)
handshake).
FIN (Finish) Indicates termination of the connection.

4.4.3.2 UDP (User Datagram Protocol):


UDP (User Datagram Protocol), is an unreliable, connectionless protocol for
applications that do not want TCP's sequencing or flow control and wish to provide
their own. It is also widely used for one-shot, client-server-type request-reply queries
and applications in which prompt delivery is more important than accurate delivery,
such as transmitting speech or video.
UDP header format:
Figure 4.4.3.2. The UDP header.
The UDP header is 8 bytes (64 bits) in size and is followed by the UDP data
(payload). The UDP data section follows the header and contains the actual message
being transmitted. The size of the data is variable and depends on the application.

Field Name Size (Bits) Description


Source Port 16 Identifies the sender's port number.
Destination Port 16 Identifies the receiver's port number.
Specifies the total length of the UDP header
Length 16
and data in bytes.

Used for error checking of the header and


Checksum 16
data (optional in IPv4, mandatory in IPv6).

4.4.3.3 TCP and UDP Comparison:


TCP (Transmission UDP (User Datagram
Characteristic
Control Protocol) Protocol)
More complex due to
Simpler, as it does not
Complexity connection management
require a connection.
and error handling.
Connection-oriented Connectionless (sends
Connection (establishes a connection data without setting up a
before data transfer). connection).
Reliable, ensures data is
received correctly using Unreliable, does not
Reliability
acknowledgments and guarantee data delivery.
retransmissions.
Used for sequential, error- Used for fast, best-effort
Function free data transmission transmission without
across the internet. reliability concerns.
Implements flow control to
No flow control, so data
Flow Control prevent overwhelming the
is sent without waiting.
receiver.
Higher due to connection
Lower, as there are no
establishment,
Overhead additional controls or
acknowledgments, and
retransmissions.
error checking.
More powerful due to its Less powerful but faster
Power reliability and error due to minimal
correction. processing.
Slower due to overhead Faster because of
Speed
and retransmission. minimal delay.
Data No guarantee of order;
Ensures ordered data
Transmission packets may arrive out
delivery.
Order of sequence.
Uses acknowledgment and
No acknowledgment
Acknowledgment retransmissions for
mechanism.
reliability.
Used where reliability is Used where speed is
critical (e.g., web crucial (e.g., video
Application
browsing, email, file streaming, gaming,
transfers). VoIP).
4.4.4 Application Layer-FTP, HTTP, SMTP, TELNET, BOOTP and DHCP
4.4.4.1 FTP (File Transfer Protocol):
The File Transfer Protocol (FTP) is the most widely used protocol for file transfer over
the network. FTP uses TCP/IP for communication and it works on TCP port 21. FTP
works on Client/Server Model where a client requests file from Server and server sends
requested resource back to the client.
FTP uses out-of-band controlling i.e. FTP uses TCP port 20 for exchanging controlling
information and the actual data is sent over TCP port 21.
The client requests the server for a file. When the server receives a request for a file,
it opens a TCP connection for the client and transfers the file. After the transfer is
complete, the server closes the connection. For a second file, client requests again
and the server reopens a new TCP connection.
Basic model of FTP (File Transfer Protocol):

Figure 4.4.4.1. Basic model of FTP

Client Side:
1. User Interface:
o The user interacts with the system via a graphical user interface (GUI) or
command-line interface (CLI).
o The user can execute FTP commands such as get, put, ls, mkdir, etc.
2. Control Process:
o Handles commands and responses exchanged with the server.
o Establishes the control connection to send FTP commands.
3. Data Transfer Process:
o Manages file transfers between the client and the server.
o Establishes a data connection separate from the control connection.
4. Disk:
o Represents the client’s local storage, where files can be uploaded from or
downloaded to.

Server Side:
1. Control Process:
o Listens for incoming FTP commands from the client.
o Responds to commands like authentication, file requests, and directory
navigation.
2. Data Transfer Process:
o Handles the actual file transfer operations between the client and server.
o Reads files from or writes files to the server’s disk.
3. Disk:
o Represents the server’s storage, where files are stored or retrieved upon
client requests.

TCP/IP Communication:
1. Control Connection:
o A persistent connection used to exchange FTP commands and responses.
o Uses port 21 in standard FTP.
2. Data Connection:
o A separate temporary connection established for file transfers.
o Uses port 20 in standard FTP.
o Can operate in Active Mode (server initiates connection) or Passive Mode
(client initiates connection).

FTP Block Header:


Size
Field Description Example Values
(Bits)
00 (End of Data),
Specifies the type of block being 01 (Data Block),
Descriptor 8 bits
transmitted. 02 (EOF) End of File,
03 (Restart Marker)
Indicates the number of bytes in
1024 (for 1 KB data),
Byte Count 16 bits the data block that follows this
512 (for 512 bytes data)
header.

4.4.4.2 HTTP (Hyper Text Transfer Protocol):


The Hyper Text Transfer Protocol (HTTP) is the foundation of World Wide Web.
Hypertext is well organized documentation system which uses hyperlinks to link the
pages in the text documents. HTTP works on client server model. When a user wants
to access any HTTP page on the internet, the client machine at user end initiates a
TCP connection to server on port 80. When the server accepts the client request, the
client is authorized to access web pages.
To access the web pages, a client normally uses web browsers, who are responsible
for initiating, maintaining, and closing TCP connections. HTTP is a stateless protocol,
which means the Server maintains no information about earlier requests by clients.
HTTP versions:
HTTP 1.0 uses non persistent HTTP. At most one object can be sent over a
single TCP connection.
HTTP 1.1 uses persistent HTTP. In this version, multiple objects can be sent
over a single TCP connection.
HTTP Communication Diagram:
Figure 4.4.4.2 HTTP Communication Diagram
Component Description
The user’s web browser that requests web pages or resources
Client (Browser)
from the server.
A request sent by the client to retrieve a web page, data, or
HTTP Request
resource from the server.
Includes the Web Server and Database that process and serve
Server-Side Systems
client requests.
Handles incoming HTTP requests, processes them, and generates
Web Server
responses.
Stores and retrieves requested data, such as user details or
Database
webpage content.
The server sends back an HTTP response, including the
HTTP Response
requested content or an error message (e.g., 404 Not Found).

4.4.4.3 SMTP (Simple Mail Transfer Protocol):


The Simple Mail Transfer Protocol (SMTP) is used to transfer electronic mail from one
user to another. This task is done by means of email client software (User Agents) the
user is using. User Agents help the user to type and format the email and store it until
internet is available. When an email is submitted to send, the sending process is handled
by Message Transfer Agent which is normally comes inbuilt in email client software.
Message Transfer Agent uses SMTP to forward the email to another Message Transfer
Agent (Server side). While SMTP is used by end user to only send the emails, the
Servers normally use SMTP to send as well as receive emails. SMTP uses TCP port
number 25 and 587.
Client software uses Internet Message Access Protocol (IMAP) or POP protocols to
receive emails.

Figure 4.4.4.3 SMTP (Simple Mail Transfer Protocol)

Component Description
The user who composes and sends an email using an email
Sender
client (e.g., Outlook, Gmail).
Mail Server The outgoing mail server that forwards the email using
(Sender’s Side) SMTP.
The medium through which the email is transferred from the
Internet
sender’s mail server to the receiver’s mail server.
Mail Server The destination mail server that receives the email and stores
(Receiver’s Side) it until the receiver accesses it.
Receiver The user who retrieves and reads the received email.

SMTP Email Transmission Process (Step-by-Step)


1. Email Composition
o The sender writes an email using an email client and clicks send.
2. Email Sent to Sender’s Mail Server
o The email is transmitted to the sender’s Mail Server over a LAN or WAN
connection.
3. SMTP Transfers Email Over the Internet
o The SMTP protocol ensures that the email is relayed from the sender’s
mail server to the receiver’s mail server.
4. Receiver’s Mail Server Stores the Email
o The recipient’s mail server holds the email until the recipient accesses it.
5. Receiver Retrieves the Email
o The recipient accesses the email using protocols like IMAP or POP3
through an email client.

Component Description
The sender’s Mail Transfer Agent, responsible for initiating email
MTA Client
transfer.
The recipient’s Mail Transfer Agent, which processes and forwards
MTA Server
emails.
The set of instructions sent from the MTA client to the MTA
Commands
server to facilitate email transmission.
The acknowledgments or error messages returned by the MTA
Responses
server after processing the commands.
Commands follow a structure where a Keyword (highlighted in
Command
pink) is followed by arguments, which provide additional details
Format
for execution.
Comparison of HTTP and SMTP:
HTTP (Hypertext SMTP (Simple Mail
Feature
Transfer Protocol) Transfer Protocol)
Used for fetching web Used for sending emails
Purpose pages and transferring between mail servers and
hypertext data. from clients to servers.
Client-Server model, where Push-based protocol that
Communication
a browser (client) requests transfers email from sender
Model
data from a web server. to receiver via mail servers.
Default: Port 80 (HTTP) Default: Port 25 (SMTP),
Port Used and Port 443 (HTTPS - Port 465 (SMTPS), Port
Secure version). 587 (submission).
Transfers web content
Transfers email messages
Data Transfer (HTML, images, videos,
with attachments.
etc.).
Stateful (maintains a
Connection Usually stateless (each
connection during email
Type request is independent).
transfer).
Uses commands and
Uses request and response
Message responses (e.g., HELO,
structure (GET, POST,
Format MAIL FROM, RCPT TO,
PUT, DELETE, etc.).
DATA, QUIT).
Web browsers, search Email clients, mail servers,
Primary Users
engines, APIs. automated email systems.
Ensures email delivery by
Less critical for real-time storing messages in mail
Reliability
communication. servers until successfully
received.
Uses SMTPS or
Uses HTTPS for encryption
Security STARTTLS for secure
and authentication.
email transmission.
Sending an email from
Accessing a website like
Example Usage user1@example.com to
https://www.example.com
user2@example.com

4.4.4.4 TELNET:
TELNET provides a remote logon capability, which enables a user at a terminal or
personal computer to logon to a remote computer and function as if directly connected to
that computer. The protocol was designed to work with simple scroll-mode terminals.
TELNET is actually implemented in two modules:
User TELNET interacts with the terminal I/O module to communicate with a
local terminal. It converts the characteristics of real terminals to the network standard
and vice versa.
Server TELNET interacts with an application, acting as a surrogate terminal handler so
that remote terminals appear as local to the application. Terminal traffic between User
and Server TELNET is carried on a TCP connection.

Figure 4.4.4.4 Principal of Remote Login (TELNET)

Component Description
Terminal (User The client system from which a user accesses the remote server
Device) using Telnet.
A software running on the client system that sends user commands
Telnet Client
to the Telnet server.
Terminal Driver A part of the operating system that manages user input and output.
TCP/IP Stack The Transmission Control Protocol/Internet Protocol layers
(Client & Server) that handle communication between client and server.
Telnet Server The remote server that receives and processes Telnet commands.
Pseudo Terminal Simulates a terminal for handling multiple Telnet connections on
Driver the server.
Application The programs or processes that the user executes on the remote
Programs server via Telnet.
The communication medium, where data is transmitted in
Network (NVT
Network Virtual Terminal (NVT) form, ensuring compatibility
Form)
between different systems.

Step-by-Step Working of Telnet:


1. User Initiates a Telnet Session
o The Terminal sends input commands through the Telnet Client.
o The Terminal Driver processes the input before forwarding it to the
network layer.
2. Data Transmission Over TCP/IP Network
o The Telnet client converts user input into the NVT form for standardized
transmission.
o The TCP/IP stack ensures the data is transmitted reliably to the Telnet
Server.
3. Server Processes User Commands
o The Pseudo Terminal Driver on the Telnet Server simulates a local
terminal.
o It interacts with Application Programs to execute the requested
commands.
4. Response Sent Back to the Client
o The processed output is sent back via the same TCP/IP stack.
o The Telnet Client receives and displays the output on the user’s Terminal.
4.4.4.5 BOOTP (Bootstrap Protocol):
The Bootstrap Protocol (BOOTP) is a client/server protocol designed to provide
physical address to logical address mapping. BOOTP is an application layer protocol.
The administrator may put the client and the server on the same network or on different
networks, as shown in Figure 4.4.4.5. BOOTP messages are encapsulated in a UDP packet,
and the UDP packet itself is encapsulated in an IP packet.

Figure 4.4.4.5 BOOTP client and server on the same and different network

BOOTP (Bootstrap Protocol) operates in two scenarios:


1. Client and Server on the Same Network
2. Client and Server on Different Networks
(a) Client and Server on the Same Network
 The BOOTP Client sends a request message containing specific parameters (e.g.,
transaction ID 68 67).
 The BOOTP Server receives the request and processes it.
 The server sends a reply back to the BOOTP Client with the necessary
configuration details (e.g., IP address, gateway, etc.).
(b) Client and Server on Different Networks
 The BOOTP Client sends a broadcast request.
 A Relay Agent is used when the client and server are on different networks.
o The Relay Agent forwards the request as a unicast to the BOOTP Server
over the internet.
 The BOOTP Server processes the request and sends a unicast reply back to the
client through the relay agent.

4.4.4.6 DHCP (Dynamic Host Configuration Protocol):

DHCP provides static and dynamic address allocation that can be manual or automatic.
DHCP (Dynamic Host Configuration Protocol) is a protocol that lets network
administrators manage centrally and automate the assignment of Internet Protocol (IP)
addresses in an organization's network. If a machine uses Internet's set of protocol
(TCP/IP), each machine that can connect to the Internet needs a unique IP address.
When an organization sets up its computer users with a connection to the Internet, an IP
address must be assigned to each machine. Without DHCP, the IP address must be
entered manually at each computer and, if computers move to another location in another
part of the network, a new IP address must be entered. DHCP lets a network
administrator supervise and distribute IP addresses from a central point and
automatically sends a new IP address when a computer is plugged into a different place in
the network.
DHCP (Dynamic Host Configuration Protocol) is a client-server protocol that uses DHCP
servers and DHCP clients. A DHCP server is a machine that runs a service that can lease
out IP addresses and other TCP/IP information to any client that requests them. The DHCP
server typically has a pool of IP addresses that it is allowed to distribute to clients, and
these clients lease an IP address from the pool for a specific period of time, usually several
days. Once the lease is ready to expire, the client contacts the server to arrange for renewal.
DHCP clients are client machines that run special DHCP client software enabling them to
communicate with DHCP server.

DHCP clients obtain a DHCP lease for an IP address, a subnet mask, and various
DHCP options from DHCP servers in a four-step process:
 DHCP DISCOVER: The client broadcasts a request for a DHCP server.
 DHCP OFFER: DHCP servers on the network offer an address to the client.
 DHCP REQUEST: The client broadcasts a request to lease an address from one of
the offering DHCP servers.
 DHCP ACK: The DHCP server that the client responds to acknowledges the
client, assigns it any configured DHCP options, and updates its DHCP database.
The client then initializes and binds its TCP/IP protocol stack and can begin
network communication.
IP Address Allocation Mechanism
DHCP supports three mechanisms for IP address allocation.
 Automatic/ Static allocation: DHCP assigns a permanent IP address to a host.
 Dynamic allocation: DHCP assigns an IP address to a host for a limited period
of time (or until the host explicitly relinquishes the address).
 Manual allocation: Host's IP address is assigned by the network administrator,
and DHCP is used simply to convey the assigned address to the host. A
particular network will use one or more of these mechanisms, depending on the
policies of the network administrator.
Configuring the DHCP Server
To configure the DHCP server:
1. From the Control Panel, go to Administrative Tools >> Computer
Management >> Services and Application >> DHCP.
2. From the Action menu, select New Scope.
The New Scope wizard is displayed.
3. Enter the following information as prompted:

ateway) of your subnet (for example, 192.168.0.1)

4. Click Finish to exit the wizard.


The contents of the DHCP server are listed.
5. Right-click Scope [iPad dress] scope-name and select Properties.
6. In the Scope Properties box, click the Advanced tab.
7. Select BOOTP only, set the lease duration to Unlimited, and click OK.
8. Right-click Reservations.
The Controller a Properties box is displayed.
9. Enter the IP address and the MAC address for Controller A. Click
Add.
The Controller B Properties box is displayed.
10. Enter the IP address and the MAC address for Controller B. Click
Add.
The controllers are added to the right of the Reservations listing.
11. Right-click Scope [iPad dress] scope-name to disable the scope.
12. Click Yes to confirm disabling of the scope.
13. Right-click Scope and select Activate.

DHCP packet format:

Figure 4.4.4.5 : DHCP packet format

Field Name Size Description


OP Code 1 byte Message type (e.g., request or reply)
Hardware Type 1 byte Type of network (e.g., Ethernet)
Hardware Length 1 byte Length of the hardware address (MAC address)
HOPS 1 byte Number of relay agents involved
Transaction ID (XID) 4 bytes Unique identifier for DHCP communication
Time elapsed since the client started DHCP
Seconds 2 bytes
process
Flags 2 bytes Used to indicate broadcast or unicast responses
Client IP Address
4 bytes Client’s current IP address (if applicable)
(CIADDR)
Your IP Address
4 bytes Assigned IP address to the client
(YIADDR)
Server IP Address
4 bytes IP address of the DHCP server
(SIADDR)
Gateway IP Address
4 bytes IP address of the relay agent (if used)
(GIADDR)
Client Hardware Client’s MAC address (first 6 bytes used for
16 bytes
Address (CHADDR) Ethernet)
Server Name (SNAME) 64 bytes Optional server name
Filename 128 bytes Boot file name for diskless clients
Additional configuration settings (e.g., lease
DHCP Options Variable
time, DNS)

Comparison of BOOTP and DHCP:


DHCP (Dynamic Host
Feature BOOTP (Bootstrap Protocol)
Configuration Protocol)

Assigns static IP addresses and Dynamically assigns IP


Function
network configurations. addresses and configurations.

Uses a pre-configured database Assigns dynamic, static, or


IP Assignment of MAC addresses to assign reserved IPs using a lease
fixed IP addresses. mechanism.

Uses a leasing mechanism,


No lease; IP addresses are
Address Lease allowing temporary IP
permanently assigned.
assignment.
Uses UDP ports 67 (server) Uses the same UDP ports 67
Communication
and 68 (client). (server) and 68 (client).

Requires a relay agent for Also supports relay agents for


Relay Agent
inter-network communication. cross-network assignment.

Support for Modern More advanced, widely used in


Older protocol, less flexible.
Networks modern networks.

Limited options for Provides additional options like


Additional Features configuration (IP, gateway, DNS, NTP, WINS, and domain
subnet mask). name settings.
Requires manual entry of
Client Fully automated, reducing
MAC-IP mapping on the
Configuration manual configuration.
server.
Mainly used for diskless Used in almost all modern
Use Cases workstations or embedded networks (enterprise, home,
devices. cloud, etc.).

4.6 Internet Protocol (IP):


IP is the primary Layer 3 protocol in the Internet suite. In addition to internetwork routing,
IP provides fragmentation and reassembly of datagrams and error reporting. Along with
TCP, IP represents the heart of the Internet Protocol suite
4.6.1 IPv4 ADDRESSES:
An IPv4 address is a 32-bit address that uniquely and universally defines the
connection of a device (for example, a computer or a router) to the Internet.
IPv4 addresses are unique. They are unique in the sense that each address defines one,
and only one, connection to the Internet. Two devices on the Internet can never have
the same address at the same time. We will see later that, by using some strategies, an
address may be assigned to a device for a time period and then taken away and
assigned to another device.
The address space of IPv4 is 232 or 4,294,967,296.
Notations
There are two prevalent notations to show an IPv4 address: binary notation and dotted
decimal notation.
Binary Notation
In binary notation, the IPv4 address is displayed as 32 bits. Each octet is often referred
to as a byte. So it is common to hear an IPv4 address referred to as a 32-bit address or a
4-byte address. The following is an example of an IPv4 address in binary notation:
01110101 10010101 00011101 00000010
Dotted-Decimal Notation
To make the IPv4 address more compact and easier to read, Internet addresses are
usually written in decimal form with a decimal point (dot) separating the bytes. The
following is the dotted decimal notation of the above address:
117.149.29.2

Dotted-decimal notation and binary notation for an IPv4 address

IPv4 Packet Format:


Figure 20; IPv4 datagram header and payload
The fields of the IPv4 packet are as follows:
• Version: Indicates the version of IP currently used.
• IP header length (IHL); Indicates the datagram header length in 32-bit words.
• Type-of-service: Specifies how a particular upper-layer protocol would like the
current datagram to be handled. Datagrams can be assigned various levels of
importance through this field.
• Total length: Specifies the length of the entire IP packet, including data and header,
in bytes.
• Identification: Contains an integer that identifies the current datagram. This field is
used to help piece together datagram fragments.
• Flags: A 3-bit field of which the low-order 2 bits control fragmentation. One bit
specifies whether the packet can be fragmented; the second bit specifies whether the
packet is the last fragment in a series of fragmented packets.
• Time-to-live: Maintains a counter that gradually decrements down to zero, at which
point the datagram is discarded. This keeps packets from looping endlessly.
• Protocol: Indicates which upper-layer protocol receives incoming packets after IP
processing is complete.
• Header checksum: Helps ensure IP header integrity.
• Source address: Specifies the sending node.
• Destination address: Specifies the receiving node.
• Options: Allows IP to support various options, such as security.
• Data: Contains upper-layer information.

4.6.2 IPv6 ADDRESSES:


The network layer protocol in the TCP/IP protocol suite is currently IPv4
(Internetworking Protocol, version 4). IPv4 has some deficiencies (listed below) that
make it unsuitable for the fast-growing Internet.
 Despite all short-term solutions, such as subnetting, classless addressing, and
NAT, address depletion is still a long-term problem in the Internet.
 The Internet must accommodate real-time audio and video transmission. This
type of transmission requires minimum delay strategies and reservation of
resources not provided in the IPv4 design.
 The Internet must accommodate encryption and authentication of data for some
applications. No encryption or authentication is provided by IPv4.
To overcome these deficiencies, IPv6 (Internetworking Protocol, version 6), also
known as IPing (Internetworking Protocol, next generation), was proposed and is now
a standard. In IPv6, the Internet protocol was extensively modified to accommodate the
unforeseen growth of the Internet.
IPv6 Packet Format:
The IPv6 packet is composed of a mandatory base header followed by the payload. The
payload consists of two parts: optional extension headers and data from an upper layer.
The base header occupies 40 bytes, whereas the extension headers and data from the
upper layer contain up to 65,535 bytes of information.

Figure 21: IPv6 datagram header and payload

Figure 22: Format of an IPv6 datagram


Base Header: Figure 22 shows the base header with its eight fields. These fields are as
follows:
 Version. This 4-bit field defines the version number of the IP. For IPv6, the value
is 6.
 Priority. The 4-bit priority field defines the priority of the packet with respect to
traffic congestion. We will discuss this field later.
 Flow label. The flow label is a 3-byte (24-bit) field that is designed to provide
special handling for a particular flow of data.
 Payload length. The 2-byte payload length field defines the length of the IP
datagram excluding the base header.
 Next header. The next header is an 8-bit field defining the header that follows the
base header in the datagram. The next header is either one of the optional extension
headers used by IP or the header of an encapsulated packet such as UDP or TCP.
Each extension header also contains this field. Table 20.6 shows the values of next
headers. Note that this field in version 4 is called the protocol.
 Hop limit. This 8-bit hop limit field serves the same purpose as the TTL field in
IPv4.
 Source address. The source address field is a 16-byte (128-bit) Internet address
that identifies the original source of the datagram.
 Destination address. The destination address field is a 16-byte (128-bit) Internet
address that usually identifies the final destination of the datagram. However, if
source routing is used, this field contains the address of the next router.

 Next header codes for IPv6:


4.6.3 Comparison between IPv4 and IPv6:
Feature IPv4 IPv6
Address
32-bit (4 bytes) 128-bit (16 bytes)
Length
Limited number of Vastly larger addressing
Address Space
addresses (32-bit) space
No broadcast; uses
Broadcasting Uses broadcast addresses
multicast instead
Supported at hosts and Only supported at the
Fragmentation
routers originating host
Header No checksum in the
Includes a checksum
Checksum header
Header Uses extension headers for
Includes optional fields
Options optional data
Addressing Classful addressing
Classless addressing
Scheme (Classes A, B, C, D, E)
Uses decimal dotted
Uses hexadecimal notation
Notation notation (e.g.,
(e.g., 2001:db8::1)
192.168.1.1)
4.7 IP Address Classes:
IP Address classes were the original organizational structure for IP addresses. The
specific address class would determine the maximum potential size for a computer
network. The address class would define which of the specific bits of the address
would be used to identify the network and network identification (Net ID), the bits
to identify the host computer and host ID, and total number of host subnets
permitted per network.

IPv4 addressing, at its inception, used the concept of classes. This architecture is
called classful addressing. In classful addressing, the address space is divided into
five classes: A, B, C, D, and E. Each class occupies some part of the address space.

Class A:
Class A range for first byte is 0-127. Class A type of IP addresses have First byte
consisting of Network address with first bit as 0 and the next 3 bytes with host id.
Hence, number of hosts are more when compared to number of networks. The
default subnet masks for class A networks is 255.0.0.0. Class A networks have
their network addresses from 1.0.0.0 to 126.0.0.0, with the zero's being replaced by
node addresses.
Class B:
Class B range for first byte is 128-191. This type has first two bytes specifying
network ID with starting two bits as 10 and last two bytes referring to host ID. The
default subnet masks for class B is 255.255.0.0. Network addresses for these
ranges from 128.0.0.0 to 191.0.0.0.
Class C:
Class C range for first byte is 192-223. This class has first three bytes referring to
network with starting bits as 110 and last byte signifies Host ID. Here, number of
networks is more when compared to number of hosts in each network.
The default subnet masks for class C is 255.255.255.0 The network IP addresses
for these range from 192.0.0.0 to 223.0.0.0.
Class D:
Class D range for first byte is 224-239 Class D is used for multicasting and its
starting bits are 1110
Class E:
Class E range for first byte is 240-255 .Class E is reserved for future use and its
starting bits are 1111

Figure 4.7.: IP address classes


Special IP addresses:

4.7.1 Subnet Mask:


To define the network and host portions of an address, the devices use a separate 32-bit
pattern called a subnet mask. We express the subnet mask in the same dotted decimal
format as the IPv4 address. The subnet mask is created by placing a binary 1 in each bit
position that represents the network portion and placing a binary 0 in each bit position
that represents the host portion.
The prefix and the subnet mask are different ways of representing the same thing - the
network portion of an address.

The subnet address is used to identify the network itself. A routing table contains a list
of known networks, and each network is identified by its subnet address. Subnet
addresses contain all 0 bits in the host portion of the address.
For example, 192.168.1.0/24 is a subnet address. This can be determined by looking at
the address and subnet mask in binary:
IP Address: 11000000.10101000.00000001.00000000
Subnet Mask: 11111111.11111111.11111111.00000000
Note that all host bits in the address are set to 0.

4.7.2 Subnetting:
Conversion of host bits to network bits. Subnetting is the strategy used to partition a
single physical network into more than one smaller logical sub-network, called subnets.
An IP address includes a network segment and a host segment. Subnets are designed by
accepting bits from the IP address's host part and using these bits to assign a number of
smaller sub-networks inside the original network. Subnets were initially designed for
solving the shortage of IP addresses over the Internet. The subnetting process allows
the administrator to divide a single Class A, Class B, or Class C network number into
smaller portions. The subnets can be subnetted again into subsubnets.

Dividing the network into a number of subnets provides the following benefits:
 Reduces the network traffic by reducing the volume of broadcasts
 Helps to exceed the constraints in a local area network (LAN), for example, the
maximum number of permitted hosts.
 Enables users to access a work network from their homes; there is no need to
open the complete network.
Types of Subnetting:
Subnetting of a network may be carried out in the following two ways.

Fixed Length Subnetting:


When we perform sub netting, all subnets have the same number of hosts, this is
known as FLSM (Fixed length subnet mask). Fixed length subnetting also called as
classful subnetting divides the network into subnets where-
 All the subnets are of same size.
 All the subnets have equal number of hosts.
 All the subnets have same subnet mask.
Variable Length Subnetting:
Variable Length Subnet Mask (VLSM) is a process of dividing an IP space into the
subnets of different sizes without wasting IP addresses. 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.

Example 01: Consider-


o We have a big single network having IP Address 200.1.2.0.
o We want to do subnetting and divide this network into 2 subnets.

Clearly, the given network belongs to class C.


Also Read- Classes of IP Address
For creating two subnets and to represent their subnet IDs, we require 1 bit.
So,
o We borrow one bit from the Host ID part.
o After borrowing one bit, Host ID part remains with only 7 bits.

o If borrowed bit = 0, then it represents the first subnet.


o If borrowed bit = 1, then it represents the second subnet.
IP Address of the two subnets are-
o 200.1.2.00000000 = 200.1.2.0
o 200.1.2.10000000 = 200.1.2.128
Network Communication Models 4. 85

For 1st Subnet-


o IP Address of the subnet = 200.1.2.0
o Total number of IP Addresses = 27 = 128
o Total number of hosts that can be configured = 128 – 2 = 126
o Range of IP Addresses = [200.1.2.00000000, 200.1.2.01111111]
= [200.1.2.0, 200.1.2.127]
o Direct Broadcast Address = 200.1.2.01111111 = 200.1.2.127
o Limited Broadcast Address = 255.255.255.255
For 2nd Subnet-
o IP Address of the subnet = 200.1.2.128
o Total number of IP Addresses = 27 = 128
o Total number of hosts that can be configured = 128 – 2 = 126
o Range of IP Addresses = [200.1.2.10000000, 200.1.2.11111111] = [200.1.2.128, 20
o Direct Broadcast Address = 200.1.2.11111111 = 200.1.2.255
o Limited Broadcast Address = 255.255.255.255

Example-02: Consider-
o We have a big single network having IP Address 200.1.2.0.
o We want to do subnetting and divide this network into 4
subnets. Clearly, the given network belongs to class C.

For creating four subnets and to represent their subnet IDs, we require 2 bits.
So,

Mr.S.Y.Divekar.
Network Communication Models 4. 86

o We borrow two bits from the Host ID part.


o After borrowing two bits, Host ID part remains with only 6 bits.

o If borrowed bits = 00, then it represents the 1st subnet.


o If borrowed bits = 01, then it represents the 2nd subnet.
o If borrowed bits = 10, then it represents the 3rd subnet.
o If borrowed bits = 11, then it represents the 4th
subnet. IP Address of the four subnets are-
o 200.1.2.00000000 = 200.1.2.0
o 200.1.2.01000000 = 200.1.2.64
o 200.1.2.10000000 = 200.1.2.128
o 200.1.2.11000000 = 200.1.2.192

Mr.S.Y.Divekar.
Network Communication Models 4. 87

For 1st Subnet-


o IP Address of the subnet = 200.1.2.0
o Total number of IP Addresses = 26 = 64
o Total number of hosts that can be configured = 64 – 2 = 62
o Range of IP Addresses = [200.1.2.00000000, 200.1.2.00111111] = [200.1.2.0, 200.
o Direct Broadcast Address = 200.1.2.00111111 = 200.1.2.63
o Limited Broadcast Address = 255.255.255.255

For 2nd Subnet-


o IP Address of the subnet = 200.1.2.64
o Total number of IP Addresses = 26 = 64
o Total number of hosts that can be configured = 64 – 2 = 62
o Range of IP Addresses = [200.1.2.01000000, 200.1.2.01111111] = [200.1.2.64, 200
o Direct Broadcast Address = 200.1.2.01111111 = 200.1.2.127
o Limited Broadcast Address = 255.255.255.255

For 3rd Subnet-


o IP Address of the subnet = 200.1.2.128
o Total number of IP Addresses = 26 = 64
o Total number of hosts that can be configured = 64 – 2 = 62
o Range of IP Addresses = [200.1.2.10000000, 200.1.2.10111111] = [200.1.2.128, 20
o Direct Broadcast Address = 200.1.2.10111111 = 200.1.2.191
o Limited Broadcast Address = 255.255.255.255
For 4th Subnet-
o IP Address of the subnet = 200.1.2.192
o Total number of IP Addresses = 26 = 64
o Total number of hosts that can be configured = 64 – 2 = 62
o Range of IP Addresses = [200.1.2.11000000, 200.1.2.11111111] = [200.1.2.192, 20
o Direct Broadcast Address = 200.1.2.11111111 = 200.1.2.255
o Limited Broadcast Address = 255.255.255.255

Mr.S.Y.Divekar.
Network Communication Models 4. 88

4.7.3 Supernetting:
The inverse of subnetting is supernetting. Instead of moving mask bits to the right
of the default mask for subnetting, we move mask bits to the left for supernetting.
With subnetting we create more network address at the host expense of host
address. With supernetting we create more host address at the expenses of network
addresses. Supernetting is not for users, it is only for Internet Service Providers
who are attempting to obtain the most efficient allocation of IP address using the A,
B, C class scheme. In this method networks bits are convert into host bits.
CIDR (Classless Inter-Domain Routing) is scheme used to route the network
traffic across the internet. CIDR is a supernetting technique where the several
subnets are combined together for the network routing. In simpler words, CIDR
allows the IP addresses to be organized in the subnetworks independent of the value
of the addresses. Before CIDR, public IP addresses were assigned based on the
class boundaries:
 Class A – the classful subnet mask is /8. The number of possible IP
addresses is 16,777,216 (2 to the power of 24).
 Class B – the classful subnet mask is /16. The number of addresses is 65,536
 Class C – the classful subnet mask is /24. Only 256 addresses available.
Figure 4.7.3 shows how four separate Class C networks may be combined to create one
large supernetwork.

Figure 4.7.3 : supernetting network

Mr.S.Y.Divekar.
Network Communication Models 4. 89

Figure 16 shows IP addresses within the following Class C subnetworks:


192.168.64.0
192.168.65.0
192.168.66.0
192.168.67.0

These four smaller networks have been combined to create the


192.168.64.0 supernetwork. Class C supernetworks will usually assume
the address of the subnetwork with the lowest IP address, in this case,
192.168.64.0.
Creating the supernetwork mask
The default subnet mask for Class C networks is 255.255.255.0. In binary format,
this is written as:
11111111.11111111.11111111.00000000.

The 1s in the mask represent the network ID (Netid) section of the address, and the 0s
represent the host ID (Hostid) section. When a subnetwork is created, we first create the
subnet mask by changing some of the 0s in the Hostid section to 1s
For example, to create four separate subnetworks from one Class C network, we would
simply add two bits (22 = 4) to the default subnet mask. Example A shows how this is
done.

With this new subnet mask, the network has been transformed from one Class C

Mr.S.Y.Divekar.
Network Communication Models 4. 90

network with up to 254 hosts to four separate subnetworks, each with 64 (26 = 64)
hosts. However, because the IP with all host bits set to 0 and the IP address with all bits
set to 1 are both reserved, there is actually a limit of 62 hosts for each subnetwork.

Mr.S.Y.Divekar.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy