0% found this document useful (0 votes)
38 views39 pages

Network Architecture: Requirements of Computer Network

The document provides an overview of network architecture and the OSI 7-layer model. It discusses: - Network architecture frameworks that guide design and implementation, including the OSI and Internet (TCP/IP) models. - Key aspects of the OSI model including its 7 layers and the functions of each layer, such as physical layer defining transmission medium/rate, and transport layer providing process-to-process delivery across networks. - Principles of layered network architecture including modularity, abstraction of each layer, and protocols defining interfaces between layers and systems.

Uploaded by

Bhanumathi
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)
38 views39 pages

Network Architecture: Requirements of Computer Network

The document provides an overview of network architecture and the OSI 7-layer model. It discusses: - Network architecture frameworks that guide design and implementation, including the OSI and Internet (TCP/IP) models. - Key aspects of the OSI model including its 7 layers and the functions of each layer, such as physical layer defining transmission medium/rate, and transport layer providing process-to-process delivery across networks. - Principles of layered network architecture including modularity, abstraction of each layer, and protocols defining interfaces between layers and systems.

Uploaded by

Bhanumathi
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/ 39

CS52 – COMPUTER NETWORKS

UNIT - I
LAYERING AND NETWORK ARCHITECTURE
Network Architecture
Requirements of computer network,
– Connectivity
– Cost effective resource sharing
– Support for common services
– Reliability
Network Architecture – It is a framework that guides the design and implementation of networks.
Widely used architectures,
– OSI architecture
– Internet architecture (TCP/IP Model)
Layering and Protocols
– Services offered by the underlying hardware, and then add a sequence of layers, each
providing a higher level of services.
– These services are implemented in terms of services provided by the lower layers.
Features of Layering,
– Decomposes the problem of building a network into more manageable components.
 Each layer solves one part of the problem
– Modular design
 Easy to add a new service
 Only need to modify the functionality at one layer

Layered Network System

 The above layered system having two layers of abstraction sandwiched between the
underlying hardware and the application program.

Layered System with alternate abstraction


 The above layered system having multiple abstractions provided at any level of the system.
 Two types of channel,
– request/reply service
– Message stream service
Protocol
 Protocol defines the interfaces between the layers in the same system and with the layers of
peer system.
 Protocol defines two interfaces.
 Service interfaces – interface between objects in the same machine
 Peer interfaces - messages exchanged with peer

Protocol Graph

– Nodes of the graph correspond to protocol.


– Edges represent “depends on” relation

Protocol Graph

Protocol Specification
– Combination of prose, pseudo code, state transition diagrams, packet formats and abstract
notations.
Encapsulation
– when application program sends a message to its peer by passing the message to protocol,
 Protocol must communicate control information to its peers by attaching a
“Header” to the message.
 Header – small piece of information used among peers to communicate each other.
 Format of the header is defined by protocol specification.
 Payload – data being transmitted by the application
– Encapsulation is adding an applications data into the new message created by the protocol.
– When a message arrives at the destination host, it is processed in the reverse order.
 Removes the header attached by its peer, takes the action indicated by that header
and passes the body of the message to the application.

High level messages are encapsulated into the low level messages

Multiplexing – multiple flows of data over a single physical link.

OSI ARCHITECTURE
OSI – Open Systems Interconnection

OSI Architecture (7 Layer Model)


Exchange of Data in OSI Model
Functions of OSI Layers:

Physical Layer
 The physical layer defines the characteristics of the interface between the devices and the
transmission medium. It also defines the type of transmission medium.
 Representation of bits - defines the type of encoding (how 0’s and 1’s are changed to signals).
 Transmission rate (Number of bits sent per second) is defines by the physical layer.
 Synchronization – sender and receiver clock is synchronized by physical layer.
 It defines how the machines are connected to make a network.

Transmission of bits in Physical Layer


Data Link Layer
Framing - divides the stream of bits received from the network layer into manageable data units
called frames.
 Physical Addressing - If frames are to be distributed to different systems on the network, the
data link layer adds a header to the frame to define the sender and/or receiver of the frame. If
the frame is intended for a system outside the sender's network, the receiver address is the
address of the device that connects the network to the next one.
 Flow Control - If the rate at which the data are absorbed by the receiver is less than the rate at
which data are produced in the sender, the data link layer imposes a flow control mechanism to
avoid overwhelming the receiver.
 Error Control - The data link layer adds reliability to the physical layer by adding mechanisms
to detect and retransmit damaged or lost frames. It also uses a mechanism to recognize duplicate
frames. Error control is normally achieved through a trailer added to the end of the frame.
 Access Control - When two or more devices are connected to the same link, data link layer
protocols are necessary to determine which device has control over the link at any given time.

Network Layer
 Responsible for the source to destination delivery of the packets across multiple networks. If
two systems are connected to the same link, there is usually no need for a network layer.
 Logical Addressing - If a packet passes the network boundary, we need to distinguish the
source and destination systems. The network layer adds a header to the packet that includes the
logical addresses of the sender and receiver.
 Routing - When independent networks or links are connected to create internetworks (network
of networks) or a large network, the connecting devices (called routers or switches) route or
switch the packets to their final destination. One of the functions of the network layer is to
provide this mechanism.

Packet Transfer in Network Layer


Transport Layer
 Responsible for process-to-process delivery of the entire message.
 Process – application program running on a host.
 Service point Addressing - Computers often run several programs at the same time. For this
reason, source-to- destination delivery means delivery not only from one computer to the next
but also from a specific process (running program) on one computer to a specific process
(running program) on the other. The transport layer header must therefore include a type of
address called a service-point address (or port address). The network layer gets each packet to
the correct computer; the transport layer gets the entire message to the correct process on that
computer.
 Segmentation and Reassembly - A message is divided into transmittable segments, with
each segment containing a sequence number. These numbers enable the transport layer to
reassemble the message correctly upon arriving at the destination and to identify and replace
packets that were lost in transmission.
 Connection Control - The transport layer can be either connectionless or connection
oriented. A connectionless transport layer treats each segment as an independent packet and
delivers it to the transport layer at the destination machine. A connection oriented transport
layer makes a connection with the transport layer at the destination machine first before
delivering the packets. After all the data are transferred, the connection is terminated.
 Flow Control – similar to flow control in data link layer, however, transport layer performing
end to end flow control.
 Error Control – Transport layer provides end to end error control. The sending transport layer
makes sure that the entire message arrives at the receiving transport layer without error
(damage, loss, or duplication). Error correction is usually achieved through retransmission.

Session Layer
 Provides a name space that is used to tie together the potentially different transport streams that
are part of a single application.
Presentation Layer
 Concerned with syntax and semantic information's exchanged between two systems.
 Responsible for Encryption and compression.
Application Layer
 Enable the user (human or software) to access the network.
 Provides the user interface for services such as E-Mail, File transfer, etc…

Summary of OSI Layer Functions


Merits of OSI Reference Model
 It distinguishes very clearly between the services, interfaces and protocols.
 The protocols in OSI model are better hidden. So they can be easily replaced by new protocols
as the technology changes.
 OSI model is truly a general model.
 It supports both connection oriented and connectionless services.
Demerits
 Sessions and presentation layer are not of much use.
 This model was devised before the protocols were invented. So in real life there is a problem of
fitting protocol into a model.

INTERNET ARCHITECTURE
– Also called as “TCP/IP architecture”.

Internet architecture
– The “Sub Network” layer shown here is sometimes referred to as “Network Layer” or “link
layer” or “Host to Network Layer”.
Host to Network layer
 Wide variety of protocols denoted NET1, NET2… NETn implemented by a combination of
hardware (eg. Network Adapter) and software (Eg. Network Device Driver).
Eg. Ethernet, FDDI
Internet Layer
 Consist of a single protocol called “Internet Protocol” (IP) that supports the interconnection
of multiple networking technologies into a single, logical network.
 Supporting protocols,
ARP (Address Resolution Protocol)
– Associates the logical address (IP) with a physical address.
RARP (Reverse Address Resolution Protocol)
– Allows host to discover the logical address when it knows the physical address.
ICMP (Internet Control Message Protocol)
– Querying and Error reporting protocol.
IGMP (Internet Group Message Protocol)
– Facilitate the simultaneous transmission of a message to a multiple recipients.
Transport Layer
 Contains two main end to end protocols,
 TCP – provides a reliable byte stream channel (Connection oriented)
 UDP – provides a unreliable datagram channel (Connectionless)
Application Layer
 Provides wide range of protocols for different applications.
 Protocols provided by this layer are,
 FTP (File Transport Protocol), TFTP (Trivial File Transport Protocol)
 SMTP (Simple Message Transfer Protocol)
 Telnet (Remote Login)
 HTTP (Hyper Text Transfer Protocol), etc…

Internet Protocol Graph


Three Features of Internet Architecture
 Does not imply strict layering
– The application is free to bypass the transport layer and to directly use IP or one of the
underlying layers.
 Hour glass shape protocol graph
– Wide at top, narrow in middle and wide at bottom.
– IP serves as the focal point for architecture
 It defines a common method for exchanging packets among different networks.
– Above IP can be arbitrarily many transport protocols offering a different channel
abstraction to application layer.
 It separates the Host to Host delivery with Process to Process delivery
– Below IP, the architecture allows for different network technologies, ranges from
Ethernet to wireless.
 In order to add a new protocol to the architecture, it needs to be a protocol specification and at
least one representative implementations of the specification.

PHYSICAL LINKS

 In lower level, a network can consist of two or more computers directly connected by some
physical medium, such as coaxial, twisted pair or an optical cable.
 This physical medium is called as links.
 Transmission medium is also defined as, a medium that can carry information from a source to a
destination.

Transmission media is classified into two categories,


 Guided (Wired)
 Unguided (Wireless)

Guided Media
– Provide a conduit from one device to another device.
– Coaxial
– Twisted Pair
– Fiber optic
– Here coaxial and twisted pair cables accept and transport signal in the form of electrical
signals.
– Fiber optic cable accepts and transport signals in the form of light.

i. Twisted Pair
– Consist of two conductors (metallic), each with its own plastic insulation.

 One wire is used to carry the signals to the receiver.


 Another one for ground reference.
– Interference and cross talk may affect both the wires and make unwanted noise.
– Twisting the cable makes it probable that both wires are equally affected by external
influences (noise or crosstalk).
– The receiver calculates the difference between the two, receives no unwanted signals. The
unwanted signals are mostly canceled out.
– The number of twists per unit of length (e.g., inch) has some effect on the quality of the
cable.
Types,
 Shielded (STP)
 Unshielded (UTP)

Applications:
 Telephone Network
 Local Area Network (10BaseT, 100BaseT)
ii. Coaxial Cable
– Carries signals of higher frequencies than twisted pair.
– Coaxial has central core conductor of solid copper wire enclosed in an insulating sheath.
– The outer metallic wrapping serves both as a shield against noise and as the second
conductor, which completes the circuit.
– This outer conductor is also enclosed in an insulating sheath.

Categories of Coaxial cable

Category Use

RG-59 Cable TV

RG-58 Thin Ethernet

RG-11 Thick Ethernet


Applications
 Cable TV
 Traditional LAN

iii. Fiber Optic cable

– Made of glass or plastic; signals are transmitted as light pulses from an LED or laser
– Light is also a form of electromagnetic energy
– Speed depends on density of medium it is traveling through; fastest when in a vacuum,
186,000 miles/second
– Propagation Modes,
 Single Mode
 Multi-Mode

Single Mode:
– Made from doped silica
– Very high bandwidth
– Very small core diameter
– Allows only one mode of propagation

Multimode Graded Index Fiber:


– The difference in refractive index is obtained gradually from center towards
interface.
– Path of light propagation is helical.
– Has higher bandwidth.

Multimode Step Index Fiber:


– The difference in refractive indices is obtained in single step.
– The path of light propagation is in Zig Zag manner.
– Has lower bandwidth.

Advantages of Fiber Optics


 Higher bandwidth than twisted-pair and coaxial cable; not limited by
medium, but by equipment used to generate and receive signals
 Noise resistance
 Less signal attenuation
 More resistant to corrosive materials
 Lightweight
 Greater security

Unguided Media
– Wireless medium

CHANNEL ACCESS LINK


 Bandwidth of a medium that linking two devices is greater than the bandwidth needs of the devices,
the link can be shared
 A channel-access scheme is based on a multiplexing method that allows several data streams or
signals to share the same communication channel or physical medium.
 Channel access method or multiple access method allows several terminals connected to the same
multi-point transmission medium to transmit over it and to share its capacity.
Multiplexing Methods
 FDM (Frequency Division Multiplexing) - Analog
 TDM (Time Division Multiplexing) - Digital
 WDM (Wave Division Multiplexing) – Analog

FDM (Frequency Division Multiplexing)


Applied when the bandwidth of a link (in hertz) is greater than the combined bandwidths of
the signals to be transmitted.
Signals generated by each sending device modulate different carrier frequencies. These
modulated signals are then combined into a single composite signal that can be transported by the
link.
A very common application of FDM is AM and FM radio broadcasting.
TDM (Time Division Multiplexing)
 TDM is a digital process that allows several connections to share the high bandwidth of
a link.
 Instead of sharing a portion of the bandwidth as in FDM, time is shared.

WDM (Wave Division Multiplexing)


 Use the high-data-rate capability of fiber-optic cable.
 Using a fiber-optic cable for one single line wastes the available bandwidth.
Multiplexing allows us to combine several lines into one.
 WDM is conceptually the same as FDM, except that the multiplexing and
demultiplexing involve optical signals transmitted through fiber-optic channels.

Multiple Access Methods


When nodes or stations are connected and use a common link, called a multipoint or broadcast
link, we need a multiple-access protocol to coordinate access to the link.

Multiple Access
Protocols

Random Access Controlled Access Channelization


Protocols Protocols Protocols

ALOHA Reservation FDMA

CSMA Polling TDMA


CSMA/CD
CSMA/CA Token Ring CDMA

i. Random Access Method


- There is no scheduled time for a station to transmit. Transmission is random among the
stations.
Methods,
 ALOHA
o Pure ALOHA
o Slotted ALOHA
 CSMA
o 1 – persistent
o Non persistent
o p - persistent
 CSMA/CD
 CSMA/CA
ii. Controlled Access Method
- The stations consult one another to find which station has the right to send.
- A station cannot send unless it has been authorized by other stations.
Types,
 Reservation
- Dynamic Time Division Multiple Access (Dynamic TDMA)
- Packet reservation multiple access (PRMA)
- Reservation ALOHA (R-ALOHA)
 Polling
 Token Passing
iii. Channelization Technique
– Channelization is a multiple-access method in which the available bandwidth of a link is
shared in time, frequency, or through code, between different stations.
Types,
 FDMA (Frequency Division Multiple Access)
 TDMA (Time Division Multiple Access)
 CDMA (Code Division Multiple Access)

HYBRID MULTIPLE ACCESS TECHNIQUE


GSM (Global System for Mobile Communication)
 Combines FDD (Frequency Division Duplex) with TDMA & FDMA.
 FDD – Transmitter & receiver operate at different carrier frequencies.
 FDD is used to prevent interference between outward and return channel.
 FDMA & TDMA is used for multiple handsets to work in a single cell.
 GSM with GRRS (General Packet Radio Service) combines the FDD & FDMA with slotted
ALOHA for reservation inquiries and Dynamic TDMA for transferring the actual data.
Bluetooth
 Combines frequency hopping with CSMA/CA
 FHSS (Frequency Hopping Spread Spectrum)
Method of transmitting radio signals by rapidly switching a carrier among many frequency channels
using pseudo random sequence.
This pseudo random sequence is known to both sender and receiver.
 CSMA/CA for multiple access.
Wireless LAN (IEEE 802.11b)
 Based on FDMA & DS-CDMA (Direct Sequence CDMA) combined with CSMA/CA
 DS-CDMA:
Multiple access scheme based on DSSS (Direct Sequence Spread Spectrum) by
spreading the signals from / to different users with different codes.
 FDMA & DS-CDMA is used to avoid the interference among adjacent Wireless LAN cells (or)
access point
 CSMA/CA for multiple access with in a cell.
HIPERLAN / 2
 Combines the FDMA with dynamic TDMA, meaning that resource reservation is achieved by
packet scheduling.

ISSUES IN DATALINK LAYER


The main job of the data link layer is to make the communication on the physical link reliable &
efficient.
Issues,
 Provide interface to the network layer services.
 Framing
 Flow Control
 Error Control
 Synchronization
 Link Configuration Control.
Services provided to Network layer:
• Virtual Communication
• Actual Communication

Types of services provided to the Network Layer,


 Unacknowledged Connectionless service
 Acknowledged Connectionless service
 Acknowledged Connection oriented service
Framing
– Translation of physical layer’s raw bits into a larger aggregate (or) discrete unit called
frames.
– Here beginning and end of the data are marked to recognize the frame & used in
synchronization.
Synchronization
– Receiver must know when the data begins & when it ends and also receiver should be able
to distinguish between each bit in the frame of data.
Flow Control
– Refers to the mechanisms that make sure that the sending station cannot overwhelm the
receiving station.
– Preventing the buffer overflow.
Eg., Sliding Window.
Error Control
– All transmission media have potential for introduction of errors.
– Error control mechanisms can detect as well as correct errors.
Link Configuration Control
Link Topology
 Physical arrangement of the connection between the devices.
Link Duplexity
 Simplex – only one device can transmit to other. (i.e., one direction transmit)
 Half Duplex - Both devices can transmit to each other, but not simultaneously.
 Full Duplex - Both devices can transmit simultaneously.

FRAMING
Framing:
Data link layer translates a stream of bits from the physical layer into the larger aggregate (or) discrete
unit called frames.
The hardware present in the data link layer is network adaptor. It enables the nodes to exchange frames.

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 constitute a frame
 i.e., determining where the frame begins and ends is the issue faced by the adaptor

Framing Protocols

Byte Oriented Bit Oriented

Sentinel Approach
BISYNC
HDLC
PPP

Byte Count Approach

DDCMP

Byte Oriented Protocols:


– It views each frame as a collection of bytes (Character) rather than a collection of bits.
a) Sentinel Approach:
BISYNC (Binary Synchronous Communication)
The frame format of the BISYNC protocol is,

Frames transmitted beginning with leftmost field


SYN - Beginning of a frame is denoted by sending a special SYN (synchronize)
character
STX & ETX - Data portion of the frame is contained between special sentinel
character STX (start of text) and ETX (end of text)
SOH (Start of Header) – Header information is start from this sentinel character
CRC (Cyclic Redundancy Check) – Used for error detection in the frame.
Problems in the sentinel approach,
ETX character might appear in the data portion of the frame. So it leads to the wrong end of
text calculation.
BISYNC overcomes this problem by “escaping” the ETX character by preceding it with a DLE
(data-link-escape) character whenever it appears in the body of a frame; the DLE character is also
escaped (by preceding it with an extra DLE) in the frame body. This approach is called as
“character stuffing”.
PPP (Point to Point Protocol)
 Commonly used in dial up modem links.
 It also uses the “Character Stuffing”
PPP Frame format as follows,

Flag - Special start of text character denoted as Flag

-01111110
Address, control - default values
o Address – 11111111
o Control – 11000000
Protocol - Used for demultiplexing. It identifies the high level protocol such as IP /
IPX.
Payload – Frame data (default size is 1500 bytes)
Checksum - for error detection

Byte Stuffing in PPP,


Whenever the flag value appears in the data section of the frame, escape byte
(01111101) stuffed into the data to tell the receiver that the next byte is not a flag.
Protocols used by PPP,
 LCP (Link Control Protocol)
 AP (Authentication Protocol)
 NCP (Network Control Protocol)

LCP (Link Control Protocol)


 Responsible for establishing, maintaining, configuring & terminating the links.
 All LCP packets are carried in the payload of the PPP frame with protocol field set
to “C021” in hexadecimal.

 Code – defines the type of the LCP packet. There are 11 types of LCP packet is
available.
• These 11 types of LCP packets are categorized into three category.
 First category – comprising the first four packet types (o×01 - o×04)
used for link configuration during link establishment.
 Second Category – comprising packet types o×05, o×06 for the
termination of the link.
 Third Category – comprising last five packet types (o×07 - o×11)
used for link monitoring and debugging.
 Id – value that matches the request and reply.
 Length – defines the total length of the LCP packet.
 Information – optional information.
AP (Authentication Protocol)
 PPP is mainly designed for dial up links, where the user identity verification is
necessary
 Authentication – validating the identity of a user.
 PPP uses two authentication protocols,
 PAP (Password Authentication Protocol)
 CHAP (Challenge Handshake Authentication Protocol)
NCP (Network Control Protocol)
 IPCP (Internet Protocol Control Protocol) is used as a network control protocol.

 IPCP defines 7 types of packets distinguished by the code values.

b) Byte Count Approach:


DDCMP (Digital Data Communication Message protocol)
 DDCMP uses the count field that contains the no. of bytes in the frame to find the
end of the frame.
 Suppose, if count field is corrupted framing error will arise.

SYN – starting of the frame.


count – no. of bytes in the frame.
Bit Oriented Protocols

– It simply views the frame as collection of bits.

HDLC

 Earlier called as SDLC (Synchronous Data Link Control)

 Beginning and Ending Sequence – denotes both the starting & end of the frame with the
bit sequence 01111110.
- This sequence is also transmitted during any times that the link is idle, so that
the sender and receiver can keep their clock synchronization.
Bit Stuffing
Sending side:
 On the sending side, any time five consecutive 1’s have been transmitted
from the body of the message (i.e. excluding when the sender is trying to
send the distinguished 01111110 sequence)
The sender inserts ‘0’ before transmitting the next bit.
Receiving side:
 On the receiving side,
 Five consecutive 1’s
 Next bit 0 - Stuffed, so discard it
1 - Either End of the frame marker (or)
Error has been introduced in the bit stream
 Look at the next bit
If 0 ( 01111110 )  End of the frame marker
If 1 ( 01111111 )  Error, discard the whole frame
 The receiver needs to wait for next 01111110 before it
can start receiving again.
ERROR CONTROL

TYPES OF ERROR

Whenever bits flow from one point to another, they are subject to unpredictable changes because of
interference and thermal noise.

Types of Errors

Single Bit Error Burst Error

Single Bit Error


Single-bit error means that only 1 bit of a given data unit (such as a byte, character, or packet) is
changed from 1 to 0 or from 0 to1.

Burst Error
The term burst error means that 2 or more bits in the data unit have changed from 1 to 0 or from 0
to 1.

ERROR CONTROL

ERROR DETECTION TECHNIQUES

Two approaches when the recipient detects an error


 Notify the sender that the message was corrupted, so the sender can send again, if the error
is rare, then the retransmitted message will be error-free
 Using some error correct detection and correction algorithm, the receiver reconstructs the
message.
Error Control

Error Detection Error Correction

Two Dimensional Parity


Hamming Code
Internet Checksum

CRC

Common technique for detecting transmission error


 CRC (Cyclic Redundancy Check)
 Used in HDLC, DDCMP, CSMA/CD
 Other approaches
 Two Dimensional Parity (used in BISYNC)
 Internet Checksum (used in IP)
Basic Idea of Error Detection
– To add redundant information to a frame that can be used to determine if errors have been
introduced
– Imagine (Extreme Case)
Transmitting two complete copies of data
Identical  No error
Differ  Error
Poor Scheme???
– n bit message, n bit redundant information
– Error can go undetected
In general, we can provide strong error detection technique
k redundant bits, n bits message, k << n
In Ethernet, a frame carrying up to 12,000 bits of data requires only 32-bit CRC.

Two - Dimensional Parity

It is based on “simple” (one-dimensional) parity, which usually involves adding one extra bit to
a 7-bit code to balance the number of 1s in the byte. For example,
 Odd parity sets the eighth bit to 1 if needed to give an odd number of 1’s in the byte.
 Even parity sets the eighth bit to 1 if needed to give an even number of 1’s in the byte.
Two-dimensional parity does a similar calculation for each bit position across each of the bytes
contained in the frame. This results in an extra parity byte for the entire frame, in addition to a parity bit
for each byte. Two-dimensional parity catches all 1-, 2-, and 3-bit errors and most 4-bit errors

Internet Checksum

Add up all the words that are transmitted and then transmit the result of that sum. The result is
called the checksum. The receiver performs the same calculation on the received data and compares the
result with the received checksum. If any transmitted data, including the checksum itself, is corrupted,
then the results will not match, so the receiver knows that an error occurred.
 Consider the data being checksummed as a sequence of 16-bit integers.
 Add them together using 16-bit ones complement arithmetic and then take the ones complement
of the result. That 16-bit number is the checksum.
 In ones complement arithmetic, a negative integer −x is represented as the complement of x;
– Each bit of x is inverted.
When adding numbers in ones complement arithmetic, a carryout from the most significant bit needs to
be added to the result (Wrapping).
Sender Side:
 The message is divided into 16-bit words.
 The value of the checksum word is set to 0.
 All words including the checksum are added using one's complement addition.
 The sum is complemented and becomes the checksum.
 The checksum is sent with the data.
Receiver Side:
 The message (including checksum) is divided into 16-bit words.
 All words are added using one's complement addition.
 The sum is complemented and becomes the new checksum.
– If the value of checksum is 0, the message is accepted; otherwise, it is rejected.
Example:
Frame Data: 01101101 10010011 01101101
n=8
Sender Side:
Calculating Checksum,
01101101
10010011
01101101
---------------
01101110 --------1’s Compliment-- 10010001
---------------
Checksum = 10010001
So data transmitted over the link is: 01101101 10010011 01101101 10010001

Receiver Side: (without Error)


Received Data: 01101101 10010011 01101101 10010001
Calculating Sum,
01101101
10010011
01101101
10010001
---------------
11111111 ----> All 1’s So accepted (No error)
---------------
Receiver Side: (with Error)
Received Data: 11101101 10010011 01101101
11101101
10010011
01101101
10010001
---------------------------
10000000 ---> Not all 1’s. So not accepted (Contains Error)
---------------------------
CRC (Cyclic Redundancy Check)
CRC uses small number of redundant bits to detect errors. 32 bit CRC provides strong protection
against common bit errors in messages that are 1000 bytes long. In CRC method, message is represented
as a polynomial. n+1 bit message can be represented by an ‘n’ degree polynomial.
Eg.,
– 10011010 is represented as 1*x5+1*x4+0*x3+0*x2+0*x1+1*x0 = x5+x4+1
Let M(x) is a message polynomial and C(x) is a generator polynomial. Both sender and
receiver have to agree on divisor polynomial C(x).

Sender Side:
– Message M(x) has k bits; the code word P(x) has n bits.
– The size of the message M(x) is augmented by adding (n – k) 0’s to the right-hand side.
This message is called as zero extended message. i.e., T(x) = M(x) + E(x).
T(x) – Augmented Message
– Sender uses (n-k+1) size divisor C(x) to divide (Modulo 2 division) the augmented data
T(x).
i.e., sender computes T(x) / C(x)
– The remainder will be added to the augmented message T(x). The result of n - bits are
called as code word P(x).
Receiver side:
– Receiver divide the received message P(x) with the same divisor C(x)
If the remainder is zero – No error in the message (Accepted)
Otherwise, error in the message (Rejected)
Example:
Sender:
M(x) = x7+x4+x3+xi.e., 10011010
C(x) = x3+x2+1 i.e., 1101

Therefore, code word P(x) = 10011010101


Receiver: (Without Error)
Received Data P(x) = 10011010101
Properties of Generator Polynomial,
 In general, it is possible to prove that the following types of errors can be detected by a C(x)
with the stated properties
o All single-bit errors, as long as the xk and x0 terms have nonzero coefficients.
o All double-bit errors, as long as C(x) has a factor with at least three terms.
o Any odd number of errors, as long as C(x) contains the factor (x+1).
o Any “burst” error (i.e., sequence of consecutive error bits) for which the length of the
burst is less than k bits. (Most burst errors of larger than k bits can also be detected.)
Six generator polynomials that have become international standards are:
 CRC-8 = x8+x2+x+1
 CRC-10 = x10+x9+x5+x4+x+1
 CRC-12 = x12+x11+x3+x2+x+1
 CRC-16 = x16+x15+x2+1
 CRC-CCITT = x16+x12+x5+1
 CRC-32 = x32+x26+x23+x22+x16+x12+x11+x10+x8+x7+x5+x4+x2+x+1
ERROR CORRECTION TECHNIQUE
Hamming Code
Hamming code is used to correct a single bit error. (Some hamming code can detect more than
single error).
Example:
Sender Side:
Receiver Side:
Single bit error is detected in receiver side

Error detection,
LINK LEVEL FLOW CONTROL:

Flow Control – specifies how much data the sender can transmit before receiving permission or
acknowledgement to continue from the receiver.

Flow Control

Stop and Wait Sliding Window

Stop and Wait


 Sender sends one frame at a time stops until it receives the confirmation (Acknowledgement)
from the receiver and then sends the next frame.
 Acknowledgement – small control frame that a protocol (receiver side) sends back to the
sender saying that it has received an earlier frame.
Control frame – frame with header only. (No data is in control frame)

 Timeout period may vary for different frame transmission.


Advantage:
 Simplicity
Disadvantage:
 Inefficiency i.e., it allows sender to have only one outstanding frame on the link.
Sliding Window
 Sender can transmit several frames continuously before needing an ACK.
 If ACK received by the sender before continuous transmission is finished, sender can
transmit.
 An ACK can acknowledge the correct receipt of multiple frames at a receiver (cumulative
ACK).
 Sender assigns a frame number to each frame. Frames are numbered “modulo n”.
i.e., 0 to n-1, 0, 1, 2 …n-1, 0, 1, 2 …n-1, 0, 1 … n-1…
Fig. Timeline for Sliding Window
 Sender maintains three variables,
o Sender Window Size (SWS)
o Last ACK Received (LAR) – frame number of the last acknowledgement received.
o Last Frame Sent (LFS) – frame number of the last frame sent.

LFS – LAR ≤ SWS

Moves to the right frame by Moves to the right, the size


frame, when a frame is sent of several frames at a time,
when an ACK is received

o When an acknowledgement received, the sender moves LAR to the right, thereby
allowing the sender to transmit another frame.
o Sender has to buffer the frame up to SWS frames for retransmission purpose.
 Receiver maintains three variables,
o Receiver Window Size (RWS) – upper bound on the number of out of order frames
that the receiver is willing to accept.
o Largest Acceptable Frame (LAF) – frame number of the largest acceptable frame.
o Last Frame Received (LFR) – frame number of the last frame received.

LAF – LFR ≤ RWS

Moves to the right frame by Moves to the right the size of


frame, when a frame is the several frames at a time,
received when an ACK is sent.

 When a frame with sequence number SeqNum arrives,

If SeqNum ≤ LFR or SeqNum > LAF


- Discard it (the frame is outside the receiver
window)
If LFR < SeqNum ≤ LAF
- Accept it
- Now the receiver needs to decide whether or
not to send an ACK
Fig. Sliding Window Behaviour
Automatic Repeat Request (ARQ)
 Retransmission of lost or damaged frame is referred as Automatic Repeat Request.
 Retransmission taken place,
o When error occurs in frame, receiver sends an NAK (Negative Acknowledgement)
explicitly to the sender.
o When the sender’s timer expires (due to error frame, frame lost or ACK lost), it
triggers the retransmission.
Timeout – the expected delay for sender to receive ACK for the frame

ARQ

Stop and Wait Sliding Window


ARQ ARQ

Go – Back - N Selective
ARQ Repeat ARQ
Stop and Wait ARQ
 Extension of stop and wait protocol.
 Receiver sends an ACK if frame is correctly received. Sender waits for an ACK before
transmitting the next frame.
Retransmission,
- If sender does not receive anything before timeout period expires (due to frame
lost or ACK lost), it retransmits the frame.
- Suppose if sender receives the NAK (error in frame or damaged frame), it
retransmits that error frame.

Sliding Window ARQ


Two approaches,
 Go – Back – N ARQ
 Selective Repeat ARQ
Go – Back – N ARQ:
– Go – Back – N uses sliding window flow control protocol.
– If no errors occur the operations are similar to sliding window.
– A station may send multiple frames as allowed by the window.
Retransmission,
 Receiver sends a NAK ‘i’ if frame ‘i’ contains error (or) frame ‘i’ was lost (i.e., out of
order frame). After that receiver discards all frames until the error frame (or) lost
frame was correctly retransmitted.
 If sender receives the NAK for frame ‘i’ it will retransmit frame ‘i’ and all frames
i+1, i+2… which have been sent, but not been acknowledged.
Selective Repeat ARQ
– Here sender only retransmits frames for which NAK is received.
Advantage over Go – Back – N,
 Fewer retransmissions
Disadvantages,
 More complex at sender and receiver.
 Each frame must be acknowledged individually (no cumulative acknowledgement).
 Receiver may receive out of sequence frames.

 For ACK / NAK loss, Go – Back – N is used. i.e., selective repeat work similar to Go
– Back – N.

You might also like