You are on page 1of 23

THE OSI MODEL

•The Open Systems Interconnection model is


a layered framework for the design of network
systems that allows for communication across
all types of computer systems .
•Layered architecture – 7 separate but
interconnected layers:
Physical layer
Data Link layer
Network layer
Transport layer
Session layer
Presentation layer
Application layer
BASIC OPERATION
• Within a single machine ,each layer calls upon the services of
the layer just below it.
• Between machines , layer x on a machine communicates with
layer x on another machine based on a set of protocols.
• The processes on each machine that communicate at a given
layer are called peer-to-peer processes.
• Sending machine : Each layer adds information in the form of
headers and trailers and passes it to the lower layer.
• Receiving machine : Each layer unwraps the message taking
data meant for it , and passes the rest to the upper layer.
PHYSICAL LAYER
• Coordinates the functions required to transmit a bit
stream over a physical medium.

• Functions it is concerned with :

 Physical characteristics of interfaces and media


 Representation of bits
 Data rate
 Synchronization of sender and receiver clocks
 Line configuration
 Physical topology
 Transmission mode
DATA LINK LAYER
• Responsible for node-to-node delivery and and
transforms the physical layer to a reliable link.
• Functions :

 Framing
 Physical addressing
 Flow control
 Error control
 Access control
NETWORK LAYER
• Responsible for source-to-destination delivery of a
packet , possibly across multiple networks.
• Data link layer oversees delivery of packet between 2
systems on the same network ; Network layer gets
packet from point of origin to final destination.

• Functions :

 Logical addressing
 Routing
TYPES OF ERRORS
•Single-bit Error: Only one bit of a data unit has
changed from 1 to 0 or from 0 to 1.

• Burst Error: 2 or more bits in the data unit


have changed from 1 to 0 or from 0 to1.
ERROR DETECTION
• Even if we know what type of errors can occur, we can
recognize it only when we have a copy of the intended
transmission for comparison .
• REDUNDANCY :
 Every data unit could be sent twice for comparison at
receiver - Transmission time doubles !!! :O
 A shorter group of bits may be appended to the end of
each unit instead. At receiver end , the entire stream of
bits is put through a checking function . If the bit stream
passes certain criteria, the data portion of the unit is
accepted and redundant bits are discarded . 
TYPES OF REDUNDANCY
CHECKS

• There are 4 main types of redundancy checks :

 Vertical Redundancy Check ( VRC )


 Longitudinal Redundancy Check ( LRC )
 Cyclic Redundancy Check ( CRC )
 Checksum
VERTICAL REDUNDANCY
CHECK
• Also called parity check – most common and least
expensive mechanism.
• In this technique , a redundant bit called parity bit is
appended to every data unit so that the total number of
1’s in that unit is even .
CYCLIC REDUNDANCY CHECK
• Based on binary division , unlike VRC and LRC which are
based on binary addition.
• Redundancy bits ( CRC remainder )are obtained as the
remainder when the incoming data unit is divided by a
predetermined binary number .
• CRC :1 bit less than divisor .
• Appending the CRC at the end of the data string must make
it exactly divisible by the divisor.
• This unit is divided by the same divisor, at the receiver end .
• Remainder=0 -> No error.
• Remainder !=0 -> ERROR !!!
STEPS IN CRC
1. A string of n 0’s is appended to the data unit. ( Divisor =
n+1 bits)
2. Elongated data unit/ divisor ( Binary Division ).
3. Remainder (= CRC ) replaces the n 0’s in the unit
before being transmitted.
4. At the receiver , Data unit / divisor ( the same one used
in the transmitter ).
5. Remainder of CRC checker at receiver = 0 , implies no
error.
6. Remainder != 0 indicates that the string has been
changed in transit .
CHECKSUM
• Used by higher layer protocols.
• Checksum generator :

 Unit is divided into k sections , each of n bits.


 All sections are added together using one’s complement
to get the sum.
 Sum is complemented to give the checksum.
 The checksum is sent along with the data.
• Checksum checker :

 Unit is divide into k sections, each of n bits.


 All sections are added together using one’s complement
to get the sum.
 Sum is complemented.
 If result = 0 , data is accepted ; otherwise rejected.
ERROR CORRECTION
• Error correction can be done in two ways –
1. Sender can retransmit the entire data unit.
2. Receiver can use an error-correcting code, which
automatically corrects certain errors.
• Error correcting codes require more redundancy bits
than error detection codes.
• The number of bits required to correct a multiple-bit error
is so high that it is inefficient to do so .
• Error correction is classified as :
1. Single-bit error correction
2. Burst error correction
SINGLE-BIT ERROR
CORRECTION
• Correcting the error just involves reversing the bit which
is in error .
• But how do we identify which bit it is ??
• Ex. In an ASCII character , there are 7 bits .
• Therefore, we have to distinguish between 8 different
states: error in position 1, error in position 2, .. Error in
position 7 and No error.
• A 3-bit redundant code may seem sufficient but cannot
cover the case where the error is in the redundancy bits
themselves. Hence, we need more bits!
• Let the number of data bits be m and the number of
redundancy bits required for error correction be r.
• The length of the data unit appended with the
redundancy bits is m+r.
• Therefore m+r+1 states must be discoverable by r bits .
• Ie, 2^r >= m+r+1.

Number of Number of Total bits


data bits m redundancy m+r
bits r
1 2 3
2 3 5
3 3 6
4 3 7
5 4 9
HAMMING CODE
• Used to manipulate received bits to discover which state
has occurred- developed by R.W. Hamming.
• Ex. A 7-bit ASCII code requires 4 redundancy bits tha
can be placed at the end or interspersed in between:

• Here , the bits are referred to as r1, r2, r4 and r8.


• In the hamming code , each r bit is the VRC bit for one
combination of data bits .
• The combinations used to calculate the 4 r values for a
7-bit sequence are :

 r1 : bits 1,3,5,7,9,11
 r2 : bits 2,3,6,7,10,11
 r4 : bits 4,5,6,7
 r8 : bits 8,9,10,11

• The pattern behind this strategy is to consider the binary


representation of each bit position . 
• Calculating r values ( for a 7-bit ASCII code ) :

 Place each bit of the original character in its appropriate


position in the 11-bit unit.
 Calculate even parities for various bit combinations
,which is also the value of the corresponding r bit.
 Ex. r1 is calculated to provide even parity with bits
3,6,7,10 and 11.
 The final 11-bit code is sent through the transmission
line.
• Error detection and correction :

 The receiver takes the transmission and recalculates 4


new VRCs using the same set of bits used by the sender
plus the relevant parity bit for each set .
 Then the new parity values are assembled in order of r
position (r8,r4,r2,r1).
 Ex. If the result of the above step is 0111(7 in decimal),
then the location of the error is at position 7 .
 Once the bit is identified , the receiver can reverse its
value and correct the error .
BURST ERROR CORRECTION
• A hamming code can be designed to correct burst errors
of certain lengths.
• The number of redundancy bits required for these
corrections is much higher than that required for
single-bit errors.
• Ex. For 2-bit errors, we have to take into consideration
that the combination can be any 2 bits in the entire
sequence !
?

You might also like