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

CN Unit

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)
26 views

CN Unit

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/ 66

UNIT I

INTRODUCTION AND PHYSICAL LAYER


Building a network – Requirements - Layering and protocols - Internet
Architecture – Network software – Performance ; Link layer Services -
Framing - Error Detection - Flow control.

----------------------------------------------------------------------------------------------------

NETWORKS

Definition:

● An interconnected collection of autonomous computers interconnected are


able to exchange information.

● A set of nodes connected by communication links . A node can be any


device capable of sending &/or receiving data to &/or from other nodes in
the network.

● A connected collection of hardware and software that permits information


exchange and resource sharing.
o Information = data, text, audio, video,
images,
o Resources = printers, memory, link
bandwidth

Distributed Processing

Networks use distributed processing which is termed as a task divided among


multiple computers. Instead of a single machine responsible for all aspects of a
process, separate computers handle a subset.
Performance

Performance can be measured by means of transit time, response time, number of


users, type of transmission medium, and capabilities of the connected hardware
and the efficiency of the software.
Transit time: The amount of time required for a message to travel from one device
to another.
Response time: The elapsed time between an inquiry and a response.
Reliability: Reliability is measured by the frequency of failure, the time it takes a
link to recover from a failure.
Security: Network security is protecting data from unauthorized access.

Applications

The following lists general applications of a data communication network:

● Electronic Mail (e-mail or Email) replaces snail mail. E-mail is the forwarding
of electronic files to an electronic post office for the recipient to pick up.
● Scheduling Programs allow people across the network to schedule
appointments directly by calling up their fellow worker's schedule and
selecting a time!
● Videotext is the capability of having a 2 way transmission of picture and
sound. Games like Doom, Hearts, distance education lectures, etc..
● Groupware is the latest network application, it allows user groups to share
documents, schedules databases, etc.. ex. Lotus Notes.
● Teleconferencing allows people in different regions to "attend" meetings
using telephone lines.
● Telecommuting allows employees to perform office work at home by
"Remote Access" to the network.
● Automated Banking Machines allow banking transactions to be performed
everywhere: at grocery stores, Drive-in machines etc..
● Information Service Providers: provide connections to the Internet and other
information services. Examples are CompuServe, Genie, Prodigy, America
On-Line (AOL), etc...
● Electronic Bulletin Boards (BBS - Bulletin Board Services) are dialup
connections (use a modem and phone lines) that offer a range of services
for a fee.
● Value Added Networks are common carriers such as AGT, Bell Canada, etc..
(can be private or public companies) who provide additional leased line
connections to their customers. These can be Frame Relay, ATM
(Asynchronous Transfer Mode), X.25, etc.. The leased line is the Value
Added Network.

Types of Connections

● A is an arrangement in which, two or more devices connected


together through links.
● A is a communication pathway that transfers data from one device to
another.

The connections are of two types:

1. Point to Point: This connection provides a dedicated link between two


devices.
2. Multipoint: When two or more devices share common link its is called as
multipoint connection.

Physical Topology

Physical Topology refers to the way in which network is laid out physically.
Two or more links form a topology. The topology of a network is the geometric
representation of the relationship of all the links and the linking devices tone
another.

The basic topologies are


1. Mesh
2. Star
3. Bus
4. Ring

Mesh

In a mesh topology each device has a dedicated point to point link to every other
device. The term dedicated means that the link carries traffic only between the two
devices it connects.
A fully connected mesh network therefore has n(n-1)/2 physical channels to link n
devices. To accommodate that many links every device on the network has (n-1)
I/O ports.
Merits

● Dedicated link guarantees that each connection can carry its own data load.
This eliminates the traffic problems that occur when links shared by multiple
devices.
● If one link becomes unusable, it does not incapacitate the entire system.
● Privacy or security: When every message travels along a dedicated line only
the intended recipient

Merits of Mesh topology

● No data traffic issues as there is a dedicated link between two devices which
means the link is only available for those two devices
● Mesh topology is reliable and robust as failure of one link doesn’t affect other links
and the communication between other devices on the network.
● Mesh topology is secure because there is a point to point link thus unauthorized
access is not possible.
● Fault detection is easy.

https://beginnersbook.com/2019/03/computer-network-topology-mesh-star-bus-ring-and-
hybrid/

Demerits

● The amount of cabling and the I/O ports required


● Installation and reconnection are difficult
● The sheer bulk of the wire accommodates more space than available.
● The hardware required to connect each link can be prohibitively expensive.

Star topology
Each device has a dedicated point to point link only to a central controller usually
called a hub. If one device has to send data to another it sends the data to the
controller, which then relays the data to the other connected device.

Merits
● Less expensive than a mesh topology. Each device needs only one link and
I/O port to connect it to any number of others.
● Installation and reconfigure is easy.
● Robustness. If one link fails only that link is affected.
● Requires less cable than a mesh.

Demerits
● Require more cable compared to bus and ring topologies.

Bus

One long cable acts as a backbone to link all the devices in a network Nodes are
connected to the bus cable by drop lines and taps. A drop line is a connection
running between the device and the main cable. A tap is a connector that either
splices into the main cable or punctures the sheathing of a cable to create a
contact with a metallic core. As the signal travels farther and farther, it becomes
weaker .So there is limitation in the number of taps a bus can support and on the
distance between those taps.

Merits
● Ease of installation.
● Bus uses less cabling than mesh or star topologies.

Demerits

● Difficult reconnection and isolation.


● Signal reflection at the taps can cause degradation in quality.
● A fault or break in the bus cable stops all transmission. It also reflects
signals back in the direction of origin creating noise in both directions.

Ring

Each device has a dedicated point to point connection only with the two devices
on either side of it.
A signal is passed along the ring in one direction from device to device until it
reaches the destination
Each device in the ring incorporates a repeater. It regenerates the bits and passes
them along, when it receives the signal intended for another device.

Merits:
● Easy to install and reconfigure.
● To add or delete a device requires changing only two connections.
● The constraints are maximum ring length and the number of devices.
● If one device does not receive the signal within a specified period, it issue an
alarm that alerts the network operator to the problem and its location

Demerits
A break in the ring disables the entire network. It can be solved by using a dual ring
or a switch capable of closing off the break
Categories of Network

The three primary categories are of network are Local Area Network (LAN),
Metropolitan Area Network (MAN), and Wide Area Network (WAN). The category
into which a network fall is determined by its size, ownership, the distance it covers
and its physical architecture.

LAN

● A LAN is usually privately owned and links the devices in a single office,
building or campus.
● A LAN can be as simple as two PCs or it can extend throughout a company.
LAN size is limited to a few kilometers. The most widely used LAN system is
the Ethernet system developed by the Xerox Corporation.
● It is designed to allow resources (hardware, software or data) to be shared
between PC’s or workstations. It may be used to provide a (shared) access
to remote organizations through a router connected to a Metropolitan Area
Network (MAN) or a Wide Area Network (WAN).

● Local Area Networks - a system of computers that share resources such as


hard-drives, printers, data, CPU power, fax/modem, applications, etc...
● They usually have distributed processing - means that there are many
desktop computers distributed around the network and that there is no
central processor machine (mainframe). Can be campus wide like a college
or university.
● One of the computers may be given a large capacity disk drive and may
become a server to other clients. Software can be stored on this server and
used by the whole group.
● The size of the LAN may be determined by the licensing restrictions on the
numbers per copy of software. or the number of users licensed to access
the operating system.
● Also differentiated from other types of network by transmission media and
topology.
● LAN use only one type of transmission medium
● The common LAN topologies are bus, ring and star.
● LANs have data rates in the 4 to 10 megabits per second. Can also reach
100 Mbps with gigabit systems in development.

● Intermediate nodes (i.e. repeaters, bridges and switches) allow LANs to be


connected together to form larger LANs. A LAN may also be connected to
another LAN or to WANs and MAN’s using a "router

The components used by LANs can be divided into cabling standards, hardware
and protocols. Examples of cabling standards used on LANs are:

● Cat 3, 4 and 5 cables


● IBM Type 19 cabling standards
● EIA568A and 568B
● Ethernet cabling standards: IEEE 802.3 (10Base5), IEEE 802.3a (10Base2),
IEEE 802.3i (10BaseT)
● Unshielded Twisted Pair (UTP)
● Shielded Twisted Pair (STP)
● Connectors: RJ45, RJ11, Hermaphroditic connectors, RS232, DB25, BNC,
TEE

Examples of hardware devices are:

● Network Interface Cards NICs


● Repeaters
● Ethernet Hubs or multiport repeaters
● Token Ring MultiStation Access Units (MSAUs), Control Access Units
(CAUs) and Lobe Access Modules (LAMs)
● Bridges
● Brouters
● Routers
● Gateways
● Print servers
● File servers
● Switches

Examples of LAN protocols are:


● Ethernet frame types: Ethernet_II, Ethernet_SNAP, Ethernet_802.2,
Ethernet_802.3
● Media Access Control layer (MAC layer)
● Token Ring: IBM and IEEE 802.5
● Logical Link Control Layer (LLC) IEEE 802.2
● TCP/IP
● SMB, NetBIOS and NetBeui
● IPX/SPX
● Fiber Distributed Data Interchange (FDDI)
● Asynchronous Transfer Mode (ATM)

Metropolitan Area Network


A MAN is designed to extend over an entire city.
● May be a single network such as cable TV network
● May be a means of connecting a number of LANs into a larger
network
● Resources may be shared LAN to LAN as well as device to device
Example: A company can use a MAN to connect the LANs in all its offices
throughout a city.
● A MAN can be owned by a private company or it may be a service provided
by a public company ,such as local telephone company
● Telephone companies provide a popular MAN service called (SMDS)
Switched Multi-megabit Data Services.

Wide Area Network (WAN)


● A WAN provides long distance transmission of data, voice, image and video
information over large geographic areas.
● It may comprise a country, continent or even the whole world. Transmission
rates are typically 2 Mbps, 34 Mbps, and 45 Mbps, 155 Mbps, 625 Mbps (or
sometimes considerably more).

● WAN utilize public, leased, or private communication equipment usually in


combinations and therefore span an unlimited number of miles.
● A WAN that is wholly owned and used by a single company is referred to as
an Enterprise Network. The figure represents the comparison of the different
types of networks

Internetwork
When two or more networks are connected they become an internetwork or
internet
Protocols
A protocol is a set of rules that governs data communication. It defines
what is communicated, how it is communicated, and when it is communicated.
The key elements of a protocol are syntax, semantics and timing

Syntax
It refers to the structure or format of the data. This refers the order in which
the data are presented.

Example
● The first 8 bits of data to be the address of the sender.
● The second 8 bits to be the address of the receiver.
● The rest of the stream may be the message itself
Semantics

It refers to the meaning of each section of bits. How a particular


pattern to be interpreted

What action is to be taken based on that interpretation?

Example

An address specifies the route to be taken or the final destination of


the message.

Timing

It refers to two characteristics

When data should be sent and how fast they can be sent.

Example

If a sender produces data at 100 Mbps and the receiver process data
at only 1 Mbps, it will overload the receiver and data will be lost.

Standards

Why do we need standards?


● To create and maintain an open and competitive market for equipment
manufacturers
● To guarantee national and international interoperability of data,
telecommunication technology and process
● To give a fixed quality and product to the customer
● To allow the same product to be re used again elsewhere
● To aid the design and implementation of ideas
● To provide guidelines to manufacturers, vendors, government agencies and
other service providers to ensure kind of interconnectivity.

Data communication standards are divided into two categories

De facto (from the fact):


● Standards that have not been approved by an organized body.
● It has been adopted as standards through widespread use.
● This is often established originally by manufacturers to define the
functionality of a new product or technology.

De jure (by law):


● Those that have been legislated by an officially recognized body.
Standards organizations
Standards are developed through the cooperation of standards creation
committees, forums, and government regulatory agencies.

Standards Creation Committees


● ITU, International Telecommunications Union formerly the (CCITT):
● ISO, International Standards Organization :
● ANSI, American National Standards Institute:
● IEEE, Institute of Electrical and Electronics Engineers:
● EIA, Electronic Industries Association:
● Forums
● Regulatory Agencies:
● Internet Standards

Network Architecture

Requirements on network design

A computer network must provide

● general,
● cost-effective,
● fair,
● robust, and
● High-performance connectivity among a large number of computers.
● Designing a network to meet these requirements is no small task.

A network designer has developed general blueprints---they are generally called


network ---that guide the design and implementation of networks.

The most widely referenced architectures---the OSI architecture and the


Internet architecture.

Layering and Protocols


Layering

When the system gets complex, the system designer introduces another level of
abstraction. The idea of an abstraction is to define a unifying model that captures
some important aspect of the system, encapsulate this model in an object that
provides an interface that can be manipulated by other components of the system,
and hide the details of how the object is implemented from the users of the object.

Figure: Example layered network system

Abstractions naturally lead to layering, especially in network systems. The general


idea is that one starts with the services offered by the underlying hardware, and
then adds a sequence of layers, each providing a higher (more abstract) level of
service. The services provided at the high layers are implemented in terms of the
services provided by the low layers.

Figure: Layered system with alternative abstractions available at a given layer.


Layering provides two nice features.
1. It decomposes the problem of building a network into more manageable
components.

2. It provides a more modular design. If you decide that you want to add some
new service, you may only need to modify the functionality at one layer,
re-using the functions provided at all the other layers.
Protocols

The abstract objects that make up the layers of a network system are called
. That is, a protocol provides a communication service that higher-level
objects (such as application processes, or perhaps higher level protocols) use to
exchange messages

Figure: Service and peer interfaces.


Each protocol defines two different interfaces. First, a service interface defines the
operations that local objects can perform on the protocol. For example,
request/reply protocol would support operations by which an application can send
and receive messages. Second, a protocol
defines a interface to its counterpart (peer) on another machine. This second
interface defines the form and meaning of messages exchanged between protocol
peers to implement the communication service.

A protocol defines a communication service that it exports locally, along


with a set of rules governing the messages that the protocol exchanges with its
peer(s) to implement this service.

Always peer-to-peer communication is indirect---each protocol communicates


with its peer by passing messages to some lower level protocol, which in turn
delivers the message to peer.
The suite of protocols that make up a network system with a .
.
In this example, suppose the file access program on Host 1 wants to send a
message to its peer on Host 2 using the communication service offered by
protocol RRP. In this case, the file application asks RRP to send the message on
its behalf. To communicate with its peer, RRP then invokes the services of HHP,
which in turn directly transmits the message to its peer on the other machine.
Once the message has arrived at protocol HHP on Host 2, HHP passes the
message up to RRP, which in turn delivers the message to the file application. In
this particular case, the application is said to employ the services of the
RRP/HHP.

The term protocol is sometimes it refers to the abstract interfaces---that is, the
operations defined by the service interface and the form and meaning of
messages exchanged between peers---and sometimes it refers to the module that
actually implements these two interfaces. To distinguish between the interfaces
and the module that implements these interfaces, we generally refer to the former
as a . Specifications are generally expressed using a
combination of prose, pseudo-code, state transition diagrams, pictures of packet
formats, and other abstract notations.

Encapsulation

A header is a small data structure---on the order of a few bytes to a few dozen
bytes---that is used among peers to communicate with each other. Headers are
usually attached to the front of a message. The rest of the message---i.e., the data
being transmitted on behalf of the application---is called the message's . We
say that the application's data is in the new message created by
protocol RRP. This process of encapsulation is then repeated at each level of the
protocol graph.

.
Multiplexing and Demultiplexing

In telecommunications and computer networks, multiplexing (also known as


muxing) is a process where multiple analog message signals or digital data
streams are combined into one signal over a shared medium. The aim is to share
an expensive resource. For example, in telecommunications, several phone calls
may be transferred using one wire. It originated in telegraphy, and is now widely
applied in communications.
The multiplexed signal is transmitted over a communication channel, which may
be a physical transmission medium. The multiplexing divides the capacity of the
low-level communication channel into several higher-level logical channels, one for
each message signal or data stream to be transferred. A reverse process, known
as demultiplexing, can extract the original channels on the receiver side.
A device that performs the multiplexing is called a multiplexer (MUX), and a device
that performs the reverse process is called a demultiplexer (DEMUX).
Inverse multiplexing (IMUX) has the opposite aim as multiplexing, namely to break
one data stream into several streams, transfer them simultaneously over several
communication channels, and recreate the original data stream.
LAYERS:

ISO / OSI model

The Open Systems Interconnection (OSI) architecture has been developed by the
International Organization for Standardization (ISO) to describe the operation and
design of layered protocol architectures. This forms a valuable reference model
and defines much of the language used in data communications.

Layer

●Each layer provides services to the next higher layer and shields the upper
layer from the details implemented in the lower layers.
●Each layer appears to be in direct (virtual) communication with its
associated layer on the other computer. Actual communication between
adjacent layers takes place on one computer only.
●Layering simplifies design, implementation, and testing. Only the lowest
level (Physical layer) can directly communicate with its peer
communications process into parts.

Peer-to-Peer Processes

● The processes on each machine that communicate at a given layer are


called peer-to-peer processes.
● At higher layers communication must move down through the layers on
device A aver to device B and then back up through the layers.
● Each layer in the sending device adds its own information to the
message it receives from the layer just above it. and passes the whole
package to the layer just below and transferred to the receiving device.

Interfaces between layers

● The passing of data and network information down through the layers
of the sending device and back up through the layers of the receiving
device is made possible by an interface between each pair of
adjacent layers.
● Each interface defines what information and services a layer must
provide for the layer above it.
● Well defined interfaces and functions provide modularity to a network.

OSI Reference Model


Describes a seven-layer abstract reference model for a network
architecture

Purpose of the reference model was to provide a framework


for the development of protocols

OSI Network Architecture

Physical Layer

● It coordinates the functions required to transmit a bit stream over a


physical medium.
● It deals with the mechanical and electrical specifications of the
interface and transmission media.
o Mechanical: cable, plugs, pins...
o Electrical/optical: modulation, signal strength, voltage levels,
bit times,

It also defines the procedures and functions that physical devices and interfaces
have to perform for transmission to occur.

Major responsibilities of Physical layer are

● Physical characteristics of interfaces and media:


It defines the characteristics of the interface between the
devices and the transmission media. Also defines the type of
transmission medium.

● Representation of bits:
To transmit the bits, it must be encoded into electrical or
optical signals. It defines the type of representation how 0s and
1s are changed to signals.

● Data rate:
The number of bits sent each second is also defined by the
physical layer.

● Synchronization of bits:
Sender and the receiver must be synchronized at the bit level .
i.e the sender and the receiver clocks must be synchronized.
Data link layer

The data link layer is responsible for hop-to-hop (node-to-node) delivery.


It transforms the physical layer a raw transmission facility to a reliable link. It
makes physical layer appear error free to the network layer.

The duties of the data link layer are

● Framing: The data link layer divides the stream of bits received from
the network layer into manageable data units called frames.
● Physical Addressing: If the frames are to be distributed to different
systems on the network the data link layer adds a header to the frame
to define the receiver or sender of the frame. If the frame is intended
for a system located outside the senders’ network then the receiver
address is the address of the connecting device that connects the
network to the next one.
● Flow Control: If the rate at which the data absorbed by the receiver
is less than the rate produced in the sender, the data link layer
imposes a flow control mechanism to overwhelming the receiver.
● Error control: Reliability is added to the physical layer by data link
layer to detect and retransmit loss or damaged frames. And also to
prevent duplication of frames. This is achieved through a trailer added
to the end of the frame
● Access control: When two or more devices are connected to the
same link it determines which device has control over the link at any
given time.

Network Layer

The network layer is responsible for source-to-destination delivery of a packet


across multiple networks. It ensures that each packet gets from its point of origin
to its final destination .It does not recognize any relationship between those
packets. It treats each one independently as though each belong to separate
message.

The functions of the network layer are

● Logical Addressing: If a packet has to cross the network boundary then


the header contains information of the logical addresses of the sender and
the receiver.
● Networking: When independent networks or links are connected to create
an internetwork or a large network the connective devices route the packet
to the final destination.

Transport Layer

The network layer is responsible for process-to-process delivery that is source to


destination delivery of the entire message.

The responsibilities of Transport layer are

● Service-point (port) addressing: Computers run several programs at the


same time. Source-to-destination delivery means delivery from a specific
process on one computer to a specific process on the other. The transport
layer header therefore includes a type of address called a service – point
address.
● Segmentation and reassembly: A message is divided into segments and
each segment contains a sequence number. These numbers enable the
Transport layer to reassemble the message correctly upon arriving at the
destination. The packets lost in the transmission is identified and replaced.
● Connection control: The transport layer can be either connectionless or
connection-oriented. A connectionless transport layer treats segment as
an independent packet and delivers it to the transport layer. A
connection-oriented transport layer makes a connection with the transport
layer at the destination machine and delivers the packets. After all the data
are transferred the connection is terminated.
● Flow control: Flow control at this layer is performed end to end.
● Error Control: Error control is performed end to end. At the sending side,
the transport layer makes sure that the entire message arrives at the
receiving transport layer without error. Error correction is achieved through
retransmission.

Session Layer

Session layer is the network dialog controller. It establishes, maintains, and


synchronizes the interaction between communicating systems.
Specific responsibilities of the layer are

● Dialog Control: Session layer allows two systems to enter in to a dialog.


Communication between two processes takes place either in half-duplex
or full-duplex. Example: the dialog between terminals connected to a
mainframe. Can be half-duplex.
● Synchronization. The session layer allows a process to add checkpoints
into a stream of data. Example if a system is sending a file of 2000 pages,
check points may be inserted after every 100 pages to ensure that each
100 page unit is advised and acknowledged independently. So if a crash
happens during the transmission of page 523, retransmission begins at
page 501, pages 1 to 500 need not be retransmitted.
Presentation layer

It is concerned with the syntax and semantics of the information exchanged


between two systems.

Responsibilities of the presentation layer are


● Translation The processes in two systems are usually exchanging
information in the form of character strings, numbers, and so on. The since
different computers use different encoding systems, the presentation layer
is responsible for interoperability between these different encoding
methods. At the sender, the presentation layer changes the information
from its sender-dependent format into a common format. The presentation
layer at the receiving machine changes the common format into its
receiver dependent format.
● Encryption The sender transforms the original information from to another
form and sends the resulting message over the entire network. Decryption
reverses the original process to transform the message back to its original
form.
● Compression It reduces the number of bits to be transmitted. It is
important in the transmission of text, audio and video.

Application Layer
It enables the user (human/software) to access the network. It provides user
interfaces and support for services such as electronic mail, remote file access
and transfer, shared database management and other types of distributed
information services.

Services provided by the application layer are

● Network Virtual terminal. A network virtual terminal is a software version


of a physical terminal and allows a user to log on to a remote host.
● File transfer, access and management. This application allows a user to
access files in a remote computer, to retrieve files from a remote computer
and to manage or control files in a remote computer.
● Mail services. This application provides the basis for e-mail forwarding
and storage.
● Directory services. It provides distributed database sources and access
for global information about various objects and services
Internet Architecture Model (TCP / IP)

The Internet architecture, which is also sometimes called the TCP/IP architecture
after its two main protocols are Transmission Control Protocol and Internet
Protocol

● TCP/IP is a suite of protocols, also known as the Internet Protocol Suite


● It was originally developed for the US Department of Defense Advanced
Research

TCP/IP network model layers

● As with the OSI model, the TCP/IP suite uses a layered model.
● TCP/IP model has four or five
● Some people call it a four layer suite - Application, Transport, Internet and
Network Access, others split the Network Access layer into its Physical
and Data link components.

Internet Protocol Graph:

First Layer:
● At the lowest level are a wide variety of network protocols denoted by NET1,
NET2& so on.
● These protocols are implemented by a combination of Hardware (e.g
Network adaptor) and software (e.g a network device driver).
● Protocols used in this layer Ethernet, FDDI.
● These protocols in turn may actually involve several sub layers.

Second Layer:
● This layer consists of a single protocol-the Internet protocol(IP).this protocol
that supports the interconnection of multiple networking technologies in to
a single logical internetwork.

Third Layer

● This layer contain two main protocols


● The Transmission Control Protocol (TCP) – Provides a reliable byte stream
channel
● The User Datagram Protocol (UDP) – Provide an unreliable datagram
delivery channel.
● TCP & UDP are sometimes called end- to-end protocol.

Fourth Layer:

Running above the transport layer are a range of application protocols such as FTP,
TFTP (Trivial File Transport Protocol), Telnet (remote login) and SMTP (Simple
Mail Transfer Protocol)or electronic mail that enable the interoperation of popular
applications.

Alternative view of Internet architecture

Three features:

i) Doesn’t imply strict layering

The application is free to bypass the defined transport layers and to directly use IP
or one of the underlying networks.

Programmers are free to define new channel abstractions or applications that run
on top of any of these existing protocols.

ii)Protocol Graph shape:


Hour Glass shape

Wide at top, narrow middle wide at bottom

This shape reflects the central philosophy of architecture i.e IP serves as focal
point of the architecture.

It defines common method for exchanging packets among a wide collection of


networks.

iii) Final attribute:

If a new protocol to be officially included in the architecture, there needs to both a


protocol specification and atleast one representative implementation of the
specification.

Figure TCP / IP model and its functions

Similarities between TCP/IP and OSI reference Model:


● Both models are based on layered protocols
● Both have a network, transport and application layer
● In both models, the transport service can provide a reliable end-to-end byte
stream

On the other hand, they differ in several ways:

● The numbers of layers are different


● TCP/IP does not have session or presentation layers
● OSI does not support internetworking and OSI has both connection oriented
and connectionless service in the network layer.

Network software:

● Protocol Hierarchies

● Design issues of Layers

● Connection Oriented and Connectionless Services

● Service Primitives

● The relationship of Services to Protocols

Protocol Hierarchies

Protocol:

A protocol is a set of rules and conventions agreed upon and followed by the
communicating entities for data communication. A protocol outlines the
what, how and when of a communication.

The three aspects of a protocol are −

● Syntax − It defines the format of data that is to be sent or received.

● Semantics − It defines the meaning of each section of bits that are


transferred.
● Timings − It defines the time at which data is transferred as well as the
speed at which it is transferred.

Protocol Hierarchies
Most networks are organized as a stack of layers, one on the top of another.
The number of layers and their names vary from network to network. Each
layer has a specified function and adheres to specified protocols. Thus we
obtain a stack of protocols.
The following figure illustrates a four-layer network −

The above figure represents communication between Device A and Device B.


The data stream from one device to the other is not sent directly but has to
pass through a number of layers. The layers in the same levels are called
peers and have a set of protocols for communication. Between each
adjacent layer is an interface that defines the services that are being offered
by a lower layer to the next higher layer. The dotted arrows depict virtual
communication between peer layers, while the solid arrows represent the
physical communications between the adjacent layers.

Connection Oriented and Connectionless Services

Connection Oriented Services


There is a sequence of operation to be followed by the users of connection
oriented service. These are:

1. Connection is established.

2. Information is sent.

3. Connection is released.

In connection oriented service , establish a connection before starting the


communication. When connection is established, send the message or the
information and then release the connection.

Connection oriented service is more reliable than connectionless service.


One can send the message in connection oriented service if there is an error
at the receivers end. Example of connection oriented is TCP (Transmission
Control Protocol) protocol.

Connection Less Services

It is similar to the postal services, as it carries the full address where the
message (letter) is to be carried. Each message is routed independently
from source to destination. The order of message sent can be different from
the order received.

In connectionless the data is transferred in one direction from source to


destination without checking that destination is still there or not or if it
prepared to accept the message. Authentication is not needed in this.
Example of Connectionless service is UDP (User Datagram Protocol)
protocol.
Service Primitives
A service is formally specified by a set of primitives (operations) available to
a user process to access the service. These primitives tell the service to
perform some action or report on an action taken by a peer entity. If the
protocol stack is located in the operating system, as it often is, the primitives
are normally system calls. These calls cause a trap to kernel mode, which
then turns control of the machine over to the operating system to send the
necessary packets. The set of primitives available depends on the nature of
the service being provided. The primitives for connection-oriented service
are different from those of connection-less service. There are five types of
service primitives :

1. LISTEN : When a server is ready to accept an incoming connection it


executes the LISTEN primitive. It blocks waiting for an incoming
connection.
2. CONNECT : It connects the server by establishing a connection.
Response is awaited.
3. RECIEVE: Then the RECIEVE call blocks the server.
4. SEND : Then the client executes SEND primitive to transmit its request
followed by the execution of RECIEVE to get the reply. Send the
message.
5. DISCONNECT : This primitive is used for terminating the connection.
After this primitive one can't send any message. When the client sends
DISCONNECT packet then the server also sends the DISCONNECT
packet to acknowledge the client. When the server package is received
by client then the process is terminated.

Connection Oriented Service Primitives


There are 5 types of primitives for Connection Oriented Service:

Connectionless Service Primitives


There are 4 types of primitives for Connectionless Oriented Service:

The relationship of Services to Protocols


Services:
These are the operations that a layer can provide to the layer above it in the
OSI Reference model. It defines the operation and states a layer is ready to
perform but it does not specify anything about the implementation of these
operations.
Protocols
These are set of rules that govern the format and meaning of frames,
messages or packets that are exchanged between the server and client.

PERFORMANCE:
Network performance is measured in following fundamental ways::

● Bandwidth
● Throughput
● Latency(Delay)

Bandwidth:
The number of bits that can be transmitted over the network in a certain
period of time
Bandwidth in bps
-Example:
Gigabit Ethernet can provide a bandwidth of 1Gbps.
Bandwidth in Hertz
A range of frequencies used to transmit signals which is measured in
hertz.
Throughput

● The throughput is a measure of how fast, the data can actually send
through a network
● Bandwidth is bits per second and throughput seem the same , but they
are different
-A link may have a bandwidth of ‘B’ bps , but only send ‘T’ bps
through this link with T<B always.
Latency(Delay)

● The latency or delay defines how long it takes for an entire message to
completely arrive at the destination from the time the first bit is sent
out from the source.
● Components of Latency or Delay:
Latency is made of four components :
1.Transmission delay
2.Propagation delay
3.Queueing delay
4.Processing delay
Latency = Transmission delay + Propagation delay +Queueing delay
+ Processing delay
Propagation Time:
It is the time required for a bit to travel from the source to the
destination. Propagation time can be calculated as the ratio between the link
length (distance) and the propagation speed over the communicating
medium. For example, for an electric signal, propagation time is the time
taken for the signal to travel through a wire.
Propagation time = Distance / Propagation speed
Transmission Time:

● Transmission time is a time based on how long it takes to send the


signal down the transmission line.
● It consists of time costs for an EM signal to propagate from one side
to the other, or costs like the training signals that are usually put on the
front of a packet by the sender, which helps the receiver synchronize
clocks.
● The transmission time of a message relies upon the size of the
message and bandwidth of the channel.
Transmission time = Message size / Bandwidth
Queuing Time:

● Queuing time is a time based on how long the packet has to sit around
in the router.
● Quite frequently the wire is busy, so we are not able to transmit a
packet immediately.
● The queuing time is usually not a fixed factor, hence it changes with
the load thrust in the network.
● In cases like these, the packet sits waiting, ready to go, in a queue.
These delays are predominantly characterized by the measure of
traffic on the system. The more the traffic, the more likely a packet is
stuck in the queue, just sitting in the memory, waiting.
Processing Delay:

● Processing delay is the delay based on how long it takes the router to
figure out where to send the packet.
● As soon as the router finds it out, it will queue the packet for
transmission. These costs are predominantly based on the complexity
of the protocol.
● The router must decipher enough of the packet to make sense of
which queue to put the packet in.
● Typically the lower level layers of the stack have simpler protocols. If a
router does not know which physical port to send the packet to, it will
send it to all the ports, queuing the packet in many queues immediately.
● Differently, at a higher level, like in IP protocols, the processing may
include making an ARP request to find out the physical address of the
destination before queuing the packet for transmission. This situation
may also be considered as a processing delay

Issues in the data link layer

The Data Link Layer


● This layer deals with the algorithms for achieving reliable, efficient
communication between two adjacent (i.e. physically connected by a
communication channel like a wire) machines just above the physical layer.
● Data transfer data rate and error correction are the major concerns of the
data link layer.
● Circuit errors, finite data rate and propagation delay have important
implications for the efficiency of the data transfer. The protocols used for
communications must take all these factors into consideration.

Data Link Layer Design Issues

Functions of the data link layer:

1. Providing a well-defined service interface to the network layer


2. Determining how the bits of the physical layer are grouped into frames
3. Dealing with transmission errors
4. Regulating the flow of frames so that slow receivers are not swamped by
fast senders.

Services Provided to the Network Layer

● The function of the data link layer is to provide service to the network layer.
● The principal service is transferring data from the network layer on the
source machine to the network layer on the destination machine.
● The network layer hands some bits to the data link layer for transmission to
the destination, the job of the data link layer is to transmit the bits to the
destination machine, so they can be handed over to the network layer on the
destination machine.

The data link layer can be designed to offer various services.


Three possibilities that are commonly provided are:

1. Unacknowledged connectionless service.


2. Acknowledged connectionless service.
3. Acknowledged connection-oriented service.

● Unacknowledged connectionless service consists of having the source


machine send independent frames to the destination machine without
having the destination machine acknowledge them. No connection is
established beforehand or released afterward. Good channels with low error
rates, for real-time traffic, such as speech.
● Acknowledged connectionless service. When this service is offered, there
are still no connections used, but each frame sent is individually
acknowledged. This way, the sender knows whether or not a frame has
arrived safely. Good for unreliable channels, such as wireless.
● Connection-oriented service. With this service, the source and destination
machines establish a connection before any data are transferred. Each
frame sent over the connection is numbered, and the data link layer
guarantees that each frame sent is received. Furthermore, it guarantees that
each frame is received exactly once and that all frames are received in the
right order.

When connection-oriented service is used, transfers have three distinct phases.

1. In the first phase the connection is established by having both sides


initialize variable and counter need to keep track of which frames have been
received and which ones have not.
2. In the second phase, one or more frames are actually transmitted.
3. In the third phase, the connection is released, freeing up the variables,
buffers, and other resources used to maintain the connection.

Framing
● In order to provide service to the network layer, the data link layer must use
the service provided to it by the physical layer
● What the physical layer does is accepting raw bit stream and attempt to
deliver it to the destination. This bit stream is not guaranteed to be error free.
● It is up to the data link layer to detect, and if necessary, correct errors.
● The usual approach is for the data link layer to break the bit stream up into
discrete frames and compute the checksum for each frame. When the
frames arrive at the destination, the checksum is re-computed.
There are four methods of breaking up the bit stream
1. Character count.
2. Starting and ending character stuffing.
3. Starting and ending flags, with bit stuffing.
4. Physical layer coding violations.

● The first framing method, Character count, uses a field in the header to
specify the number of characters in the frame. When the data link layer at
the destination sees the character count, it knows how many characters
follow. Problem: count can possible be misrepresented by a transmission
error. This method is rarely used anymore.

● The second framing method, Starting and ending character stuffing, gets
around the problem of resynchronization after an error by having each frame
start with the ASCII character sequence DLE STX and end with the sequence
DLE ETX. (DLE is Data Link Escape, STX is Start of Text, and ETX is End of
Text). Problem: a serious problem occurs with this method when binary
data, such as object programs or floating-point numbers, are being
transmitted it is possible that the DLE, STX, and ETX characters can occur,
which will interfere with the framing. One way to solve this problem is to
have the sender's data link layer insert and DLE character just before each
"accidental" DLE and the data link layer on the other machine removes them
before it gives the data to the network layer, this is called Character stuffing.
● The third method, Starting and ending flags with bit stuffing, allows data
frames to contain and arbitrary number of bits and allows character codes
with an arbitrary number of bits per character. Each frame begins and ends
with a special bit pattern, 01111110, called a flag byte. Whenever the
sender's data link layer encounters five consecutive ones in the data, it
automatically stuffs a 0 bit into the outgoing bit stream, which is called bit
stuffing. The receiving machine destuffs the 0 bit.

● The fourth method, Physical coding violations, is only applicable to


networks in which the encoding on the physical medium contains some
redundancy. For example, some LANs encode 1 bit of data by using 2
physical bits.

Error Control

● The next problem to deal with is who to make sure all frames are eventually
delivered to the network layer at the destination, and in proper order.
● The usual way to ensure reliable delivery is to provide the sender with some
feedback about what is happening at the other end of the line.
● One complication with this is that the frame may vanish completely, in which
case, the receiver will not react at all, since it has no reason to react.
● This possibility is dealt with by introducing timers into the data link layer.
When the sender transmits a frame, it generally also starts a timer. The timer
is set to go off after an interval long enough for the frame to reach the
destination machine. If the frame or acknowledgment is lost the timer will
go off. The obvious solution is to transmit the frame again. This creates the
problem of possible sending frames multiple times. To prevent this from
happening, it is generally necessary to assign sequence numbers to
outgoing frames, so that the receiver can distinguish retransmission from
originals.
● The whole issue of managing the timers and sequence numbers so as to
ensure that each frame is ultimately passed to the network layer at the
destination exactly one, no more no less, is an important part of the data link
layer's duties.

Flow Control

● Another important design issue that occurs in the data link layer (and higher
layers as well) is what to do with a sender that systematically wants to
transmit frames faster than a receiver can accept them.
● This situation can easily occur when the sender is running on a fast
computer and the receiver is running on a slow machine.
● The usual solution is to introduce flow control to throttle the sender into
sending no faster than the receiver can handle the traffic.
● Various flow control schemes are known, but most of them use the same
basic principle.
● The protocol contains well-defined rules about when a sender may transmit
the next frame.

1.3 Framing

With Synchronous Transmission all the letters or data in one group of data is
transmitted at one time as a block of data called a frame or packet.

The start and end of each packet sometimes is marked by adding synchronization
characters (SYN) at the start/end of each packet.

When node A wishes to transmit a frame to node B, it tells its adaptor to transmit a
frame from the node’s memory. This results in a sequence of bits being sent over
the link. The adaptor on node B then collects together the sequence of bits arriving
on the link and deposits the corresponding frame in B’s memory. Recognizing
exactly what set of bits constitutes a frame—that is, determining where the frame
begins and ends—is the central challenge faced by the adaptor.

There are many protocols for synchronous transmission that fall into three broad
categories:

● Byte-oriented (BISYNC, PPP, DDCMP)


● Bit-oriented (HDLC)
● Clock - Based Framing (SONET)

a) Byte-Oriented Protocols (BISYNC, PPP, DDCMP)

PPP PROTOCOL Frame Format

The more recent Point-to-Point Protocol (PPP), which is commonly run over dialup
modem links, is similar to BISYNC in that it uses character stuffing.

● The special start-of-text character, denoted as the Flag field is 01111110.


● The Address and Control fields usually contain default values, and so are
uninteresting.
● The Protocol field is used for demultiplexing: It identifies the high-level
protocol such as IP or IPX.
● The frame payload size can be negotiated, but it is 1500 bytes by default.
The Checksum field is either 2 (by default) or 4 bytes long.
● The PPP frame format is unusual in that several of the field sizes are
negotiated rather than fixed. This negotiation is conducted by a protocol
called LCP (Link Control Protocol).
● PPP and LCP work in tandem: LCP sends control messages encapsulated in
PPP frames—such messages are denoted by an LCP identifier in the PPP
Protocol field—and then turns around and changes PPP’s frame format
based on the information contained in those control messages.
● LCP is also involved in establishing a link between two peers when both
sides detect the carrier signal.

Figure PPP frame format

b) Bit – Oriented Protocols (HDLC)

● HDLC standardized ISO in 1979 and accepted by most other standards bodies
(ITU-T, ANSI)
● Treat frames as collections of bits, that is, pay no regard to byte boundaries.
● e.g The Synchronous Data Link Control protocol(SDLC) developed by
IBM.SDLC was later standardized by the ISO as the High Level data Link
Control (HDLC) protocol.
● 3 types of end-stations:

–sends commands
–can only responds to Primary’s commands
–can both command and respond
● 3 types of configuration(Note: no balanced multipoint)
TRANSFER MODE OF HDLC
● Mode = relationship between 2 communicating devices;
● Describes who controls the link
o NRM = Normal Response Mode
o ABM = Asynchronous Balanced Mode
o ARM= Asynchronous Response Mode
Only difference is that secondary needs permission from the Primary in NRM,
but doesn’t need permission from the Primary in ARM. But in ABM, both primary &
slave performs equal functions.

TYPES OF FRAMES:
3 types of Frames are
– (information Frame) transports user data and control info about
user data.
– supervisory Frame, only used for transporting control information
– unnumbered Frame, reserved for system management(managing
the link itself)

FRAME FORMAT

HDLC uses

Flag Fields: It has unique pattern at both the ends of frame structure – used to
indicate start & end of frame (01111110). This sequence is also transmitted during
any times that the link is idle so that the sender and receiver can keep their clocks
synchronized.
Bit Stuffing:

On the sending end any time five consecutive 1’s have been transmitted from the
body of the message, the sender inserts a 0 before transmitting next bit. On the
receiving side, should five consecutive 1’s arrive, the receiver makes its decision
based on the next bit it sees. If the next bit is 0, it must have been stuffed and so
the receiver removes it.

If the next bit is 1, then either

● This is end of frame (or) Error has been introduced in to the bit stream

By looking the next bit, the receiver can distinguish between these two cases

i. If it sees 0, then it is end of frame.


ii. If it sees 1, then there must have been error and the whole frame is discarded.

Address Fields: It states the destination address.

Control Fields: contains frame numbers. And it controls acknowledgement of


frames.
Data Fields: contains user data received from the network layer.

FCS (Frame Check Sequence) or Checksum: is an error detecting code calculated


from remaining bits of the frame.

HDLC Operation:

1. Initialization
2. Data Transfer
3. Disconnect
ERROR DETECTION AND CORRECTION

ERROR:

Data can be corrupted during transmission. For reliable communication,


errors must be detected and corrected. Signals flows from one point to another. It
is subjected to unpredictable interferences from heat, magnetism and other forms
of electricity.

TYPES OF ERRORS:

● Single bit Error:

The term single bit error means that only one bit of a given data unit is
changed from 1 to 0 or 0 to 1. 010101 is changed to 110101 here only one
bit is changed by single bit error.

● Burst Error:

A burst error means that 2 or more bits in the data unit have changed.

Example:

Here two bits are corrupted.


Three kinds of errors can occur:

● the bits in the frame can be inverted, anywhere within the frame including
the data bits or the frame's control bits,
● additional bits can be inserted into the frame, before the frame or after the
frame and
● Bits can be deleted from the frame.

DETECTION

Redundancy

Error detection use the concept of redundancy, which means adding extra
bits for detecting errors at the destination .i.e., instead of repeating the entire data
stream, a shorter group of bits may be appended to the end of each unit.

Above figure shows the process of using redundant bits to check the accuracy of a
data unit. Once the data stream has been generated, it passes through a device
that analyses it and adds an appropriately coded redundancy check.
The receiver puts the entire stream through a checking function. The received bit
stream passes the checking criteria. The data portion of the unit is accepted if
there is no error, otherwise rejected and the redundant bits are discarded.

Detection methods

● Parity check
● Cyclic redundancy check
● checksum

Parity check

A redundant bit called parity bit is added to every data unit so that the total
number of 1’s in the unit becomes even (or odd).

SIMPLE PARITY CHECK


In a simple parity check a redundant bit is added to a string of data so
that total number of 1’s in the data become even or odd.
The total data bit is then passed through parity checking function. For
even parity, it checks for even number of 1’s and for odd parity it checks even
number of 1’s. If an error is detected the data is rejected.

Example 1: data to be transmitted = 10110101

● 5 1’s in the data - Parity bit is 1


● Transmitted codeword = 101101011
● If receiver gets 101101011, parity check ok ---accept (OK)
● If receiver gets 101100011, parity check fails ---reject (OK), ask for frame to be
re-transmitted
● If receiver gets 101110011, parity check ok ---accept (NOT OK: even number of
errors undetected)
● If receiver gets 001100011, parity check ok ---accept (NOT OK: even number of
errors undetected)

Example 2: data to be transmitted = 10110001

● 4 1’s in the data


● parity bit is 0
Transmitted codeword = 101100010

2-Dimensional Parity Check


Form data into a 2-dimensional array; add single parity check bits to
each row and each column; transmit row-by-row
Example: data = 1110001 1000111 0011001

● Form 3×7 array and add row and column parity bits:
Data bits
1110001 0
1000111 0 row
0011001 1 parity bits

0101111 1
Column parity bits

● transmitted: 11100010 10001110 00110011 01011111


● Receiver knows to form received bit string into 4×8 array, then check the row
and column parity bits…
● Can detect any odd number of bit errors in a row or column, and can detect
an even number of bit errors if they’re in a single row (using the column
parity checks) or in a single column (using the row parity checks); and can
correct any single bit error

● Example (cont.): suppose bit in position (1,3) is received in error (in other
words, 1 bit
error)

1100001 row 1 parity check fails


0000111 row 2 parity check fails
0011001 row 3 parity check ok

row 4 parity check ok

column 1 parity check fails


column 2 parity check ok
column 3 parity check fails
column 4 parity check ok
column 5 parity check ok
column 6 parity check ok
column 7 parity check ok
column 8 parity check ok
Therefore the receiver can detect that bit errors Occurred, but it cannot Correct them
(here, if the Bit errors were in positions (1,3) and (2,1) instead, the receiver parity checks
would be the same)

CYCLIC REDUNDANCY CHECK

CRC is based on binary division. In CRC, instead of adding bits to achieve


the desired parity, a sequence of redundant bits, called the CRC or the CRC
remainder, is appended to the end of the data unit so that the resulting data unit
becomes exactly divisible by a second, predetermined binary number. At its
destination, the incoming data unit is assumed to be intact and is therefore
accepted. A remainder indicates that the data unit has been damaged in transit
and therefore must be rejected.

STEP BY STEP PROCEDURE

● Dividing the data unit by a predetermined divisor derives the redundancy bits
used by CRC; the remainder is CRC.
● First a starting of n 0’s is appended to the data unit. The number n is one
less than the number of bits in the predetermined divisor, which is n+ 1 bit.
● The newly elongated data unit is divided by the divisor, using a process
called binary division. The remainder resulting from this division is the CRC.
● The CRC of n bits derived in step 2 replaces the appended 0s at the end of
the data unit. Note that the CRC may consist of all 0s.
● The data unit arrives at the receiver data first, followed by the CRC. The
receiver treats the whole string as unit and divides it by the same divisor that
was used to find the CRC remainder.
● If the string arrives without error, the CRC checker yields a remainder of zero
ad the data unit passes. If the string has been changed in transit, the
division yields a non zero remainder and the data does not pass.
CRC GENERATOR AND CHECKER

CRC GENERATOR

It uses modulo-2 division. The following figure shows this process

For an example: Data: 100100 divisor :1101

CRC CHECKER

● A CRC checker function is exactly as the generator does. After receiving the
data appended with the CRC, it does the same modulo-2 division.
● If the remainder is all 0s, the CRC is dropped and the data are accepted;
otherwise, the received stream of bits is discarded and data are resent.
● The following figure shows the process of division in the receiver. We
assume that there is an error.
● The remainder is not full of 0s, and the data are rejected.

POLYNOMIALS

The divisor in the CRC most often represented not as a string of 1s and 0s,
but as an algebraic polynomial. The polynomial format is useful to solve the
concept mathematically.

A polynomial

Polynomial and Divisor


CHECKSUM

The checksum is based on the redundancy.

CHECKSUM GENERATOR

● In the sender side, the checksum generator subdivides the data unit into
equal segments of n bits.
● These segments are added using ones complement a, the total is also in n
bits long
● The total is then complemented and appended to the end of the original
data unit as redundancy bits, called the checksum field.
● The extended data is transmitted across the network.

CHECKSUM CHECKER

● The receiver subdivides the data unit into k sections each of n bits.
● All sections are added using ones complement arithmetic to get the sum.
● The sum is complemented.
● If the result is zero, the data are accepted: otherwise they are rejected.
EXAMPLE

Suppose the block of 16 bits is to be sent using a checksum of 8 bits.

10101001 00111001

The numbers are added using ones complement arithmetic


10101001

00111001

1 1 1 0 0 0 1 0 sum

0 0 0 1 1 1 0 1 Checksum (1’s complement value of


sum)

The pattern sent is

10101001 00111001 00011101

Checksum

Now the receiver receives the pattern with no error

10101001 00111001 00011101

The receiver adds these three sections, it will get all ones, which, after
complementing, are all 0s and shows that there is no error.

10101001

00111001

00011101

11111111 sum

00000000 complement (pattern is ok)

Suppose there is a burst error of length 5 that affects four bits.

10101111 11111001 00011101

When the receiver adds these sections, it gets


PERFORMANCE

● It detects all errors involving an odd number of bits as well as most


errors involving an even number of bits.
● If one or more bits of a segment are damaged and the corresponding bit
or bits of opposite value in the second segment are also damaged, the
sum of those columns will not change and the receiver will not detect the
problem.

1.8 Link – Level Flow control and Error control

The two main features of data kink layer are flow control and error control.

FLOW CONTROL

Flow control coordinates that amount of data that can be sent before receiving
ACK It is one of the most important duties of the data link layer.

ERROR CONTROL

● Error control in the data link layer is based on ARQ (automatic repeat request),
which is the retransmission of data.
● The term error control refers to methods of error detection and retransmission.
● Anytime an error is detected in an exchange, specified frames are retransmitted.
This process is called ARQ.

FLOW AND ERROR CONTROL MECHANISMS

1. STOP-AND WAIT ARQ.


2. GO-BACK-N ARQ.
3. SELECTIVE-REPEAT ARQ.

STOP-AND- WAIT ARQ

This is the simplest flow and error control mechanism.

It has the following features.

The sending devise keeps the copy of the last frame transmitted until it receives
an acknowledgement for that frame. Keeping a copy allows the sender to re-
transmit lost or damaged frames until they are received correctly.

● Both data and acknowledgement frames are numbered alternately 0 and 1.


A data frame 0 is acknowledged by an ACK 1.
● A damaged or lost frame is treated in the same manner by the receiver. If
the receiver detects an error in the received frame, it simply discards the
frame and sends no acknowledgement.
● The sender has a control variable, which we call S, that holds the number of
recently sent frame. The receiver has a control variable, which we call R that
holds the number of the next frame expected.
● The sender starts a timer when it sends a frame. If an ACK is not received
within an allotted time period the sender assumes that the frame was lost or
damaged and resends it.
● The receivers send only positive ACK for frames received safe and sound; it
is silent about the frames damaged or lost.

OPERATION:
The possible operations are

● Normal operation
● lost frame
● ACK lost
● Delayed ACK.

Normal operation

The sender sends frame 0 and wait to receive ACK 1. When ACK 1 is received it
sends frame 1 and then waits to receive ACK 0, and so on.

The ACK must be received before the time out that is set expires. The following
figure shows successful frame transmission.

Lost or damaged Frame

o When the receiver receives the damaged frame it discards it, which
essentially means the frame is lost. The receiver remains silent about a
lost frame and keeps its value of R.
o For example in the following figure the sender transmits frame 1, but it is
lost. The receiver does nothing, retaining the value of R (1). After the
timer at the sender site expires, another copy of frame 1 is sent.
Lost acknowledgement

o A lost or damaged ACK is handling in the same by the sender; if the


sender receives a damaged ACK, it discards it.
o The following figure shows a lost ACK 0.the waiting sender does not
know if frame 1 has been received. When the timer for frame 1 expires
the sender retransmits frame 1.
o Note that the receiver has already received frame 1 and is expecting to
receive frame 0. Therefore, it’s silently discards the second copy of frame
1.
Delayed acknowledgement

o An ACK can be delayed at the receiver or by some problem with the link.
The following figure shows the delay of ACK 1; it ids received after the
timer for frame 0 as already expired.

o The sender has already retransmitted a copy of frame 0. The receiver


expects frame 1 so it’s simply discards the duplicate frame 0.

o The sender has now received two ACK’s, one that was delayed and one
that was sent after the duplicate frame 0 arrived. The second ACK 1 is
discarded.
BIDIRECTIONAL TRANSMISSION

The stop – and – wait mechanism is unidirectional. We can have


bi-directional transmission if the two parties have two separate channels for full
duplex communication or share the same channel for off duplex transmission. In
this case, each party needs both S and R variables to track frames sent and
expected.

PIGGYBACKING

It’s a method to combine a data frame with an ACK. In following figure both
the sender and the receiver have data to send. Instead of sending separate data
and ACK frames. It can save bandwidth because the overhead from a data frame
and an ACK frame can be combined into just one frame.
GO-BACK-N ARQ
● As in Stop-and-wait protocol senders have to wait for every ACK then next
frame is transmitted. But in GO-BACK-N ARQ number of frames can be
transmitted without waiting for ACK. A copy of each transmitted frame is
maintained until the respective ACK is received.

Features of GO-BACK-N ARQ

1. Sequence numbers.

Sequence numbers of transmitted frames are maintained in the header


of frame. If k is the number of bits for sequence number, then the
numbering can range from 0 to 2k-1. Example: if k=3 means sequence
numbers are 0 to 7.

2. Sender sliding window:

● Window is a set of frames in a buffer waiting for ACK. This window keeps on
sliding in forward direction, the window size is fixed. As the ACK is received,
the respective frame goes out of window and new frame to sent come into
window. Figure illustrates the sliding window.
● If Sender receives. ACK 4, then it and including Frame 3
were
3. Receiver sliding window:

In the receiver side size of the window is always one. The receiver is expecting to
arrive frame in specifies sequence. Any other frame is received which is out of
order is discarded. The receiver slides over after receiving the expected frame. The
following figure shows the receiver side-sliding window.

4. Control variables:

● S = Sequence number of the recently sent frame


● SF = Sequence number of first frame in the window
● SL = Sequence number of last frame in the window
● Window Size = SL – SF + 1
● If sequence number of received frame is same as R, accept it.
5. Timers

The sender has a timer for each transmitted frame. The receivers don’t have
any timer.

6. Acknowledgement:

The receiver responds for frame arriving safely by positive ACK. For
damaged or lost frames receiver doesn’t reply, the sender has to retransmit it when
timer of that frame elapsed. The receiver may ACK once for several frames.

7. Resending frames:

● When a frame is lost or damaged, sender sends a block of frames.


● This block starts from one that has lost or damaged up to the current
frame sent.

Operation
Normal operation: Following diagram shows this mechanism. The sender keeps
track of the outstanding frames and updates the variables and windows as
acknowledgements arrive.
Damaged or lost frame:

Figure shows that frame 2 is lost. Note that when the receiver receives frame 3, it
is discarded because the receiver is expecting frame 2, not frame3. After the timer
for frame 2 expires at the sender site, the sender sends frame 2 and 3.

Damaged or lost acknowledgement:


If an ACK is lost, we can have two situations. If the next ACK arrives before
the expiration of timer, there is no need for retransmission of frames because ACK
are cumulative in this protocol. If the next ACK arrives after the timeout, the frame
and all the frames after that are resent. The receiver never resends an ACK.

Delayed Acknowledgement:

A delayed ACK also triggers the resending of frames.

SELECTIVE REPEAT ARQ:

● The size of the window should be one half of the value 2m.
● The receiver window size must also be the size. In this the receiver is
looking for a range of sequence numbers.
● The receiver has control variables RF and RL to denote the boundaries
of the window.
● Selective repeat also defines a negative ACK.
● NAK that reports the sequence number of a damaged frame before
the timer expires

Operation

Normal operation
A normal operation of the selective repeat ARQ is same as GO-BACK-N ARQ
mechanism.

Lost or damaged frame


The following figure shows operation of the mechanism with an example of
a lost frame.

Frame 0 and 1 are accepted when received because they are in the range
specified by the receiver window. When frame 3 is received, it is also accepted
for the same reason. However the receiver sends a NAK 2 to show that frame 2
has not been received. When the sender receives the NAK 2, it resends only
frame 2, which is then accepted because it is in the range of the window.

Lost and delayed ACKs and NAKs

In this sender also sets a timer for each frame sent. The remaining
operations are same as GO-BACK-N ARQ.

You might also like