DCN - 9 - Two Sub Layers of Data Link Layer

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 183

Two Sub Layers of Data Link layer

McGraw-Hill Related Chapter


©The McGraw-Hill_11 andInc.,
Companies, 122000
Related CLO-4

• Differentiate Protocols of two sub Layers of Data


link Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Data Link Layer
Hop-to-hop delivery

• This hop-to-hop delivery is the responsibility of the data link layer.


• The two data link layers, installed at adjoining hops ,control the
transmission of data through the LAN or the
McGraw-Hill ©TheWAN.
McGraw-Hill Companies, Inc., 2000
Related Chapter 11

• As we already know

• Data-link layer is divided into two sublayers.


• Upper sublayer_ Data-link Control (DLC)
• Lower sublayer _ Multiple access control (MAC)

5
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Firstly we will discuss
Data Link Control (DLC) Sub Layer

McGraw-Hill Related Chapter _11


©The McGraw-Hill Companies, Inc., 2000
DLC Services

• DLC deals with procedures for communication between


two adjacent nodes—node-to-node communication—no
matter whether the link is dedicated or broadcast.

• Data link control functions include


1. Framing
2. Flow and Error control.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


• We will discuss some fields which are shown in
Data Link layer but is actually added at the physical
layer and is not (formally) part of the frame.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


For example for Ethernet Frame

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


For example _ Ethernet Frame

• 64-bit preamble and SFD consists of alternating ones and zeros allowing the
receiver to synchronise with the incoming signal followed by the header consisting
of a 48-bit destination address, a 48-bit source address, and a 16-bit frame type
• Payload can vary in length from a minimum of 46 bytes to a maximum of 1,500
bytes
• payload is followed by a 32-bit CRC
• Ethernet standard specifies the values that can be used in the header fields; for
example
– 48-bit address FF:FF:FF:FF:FF:FF (hexadecimal), i.e. all 1s, is reserved for broadcast
– frame type value of 0800 (hexadecimal) is reserved for IPv4 traffic

10
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
For example _ Ethernet Frame

• An Ethernet packet starts with a


–  Preamble 
–  Start frame delimiter (SFD)

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


For example _ Ethernet Frame

• Preamble
– It consists of a 56-bits (seven-byte) pattern of alternating
1 and 0 bits, allowing devices on the network to easily
synchronize their receiver clocks, providing bit-level
synchronization.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


For example _ Ethernet Frame

• SFD:
– SFD provides byte-level synchronization and to mark a new
incoming frame.
– SFD is the eight-bit (one-byte) value that marks the end of the
preamble, which is the first field of an Ethernet packet, and
indicates the beginning of the Ethernet frame.
– SFD is designed to break the bit pattern of the preamble and
signal the start of the actual frame  
– SFD is immediately followed by the destination MAC address,
which is the first field in an Ethernet frame.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


For example _ Ethernet Frame

• How both works :


– Preamble field provides a predictable signal so that the
electronics in an Ethernet receiver can synchronize the
data sampling clock to the incoming message. Since
Ethernet is a self-clocked digital protocol, the clock is
extracted from the signal.
– The SFD at the end of the preamble warns when “real”
data is about to start since the receiver may lose bits of
the preamble while syncing the receive clock

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Example End

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Let us revise and define Synchronization and some Terms……….Then
we will discuss ‘Variable-size framing’ feature of Data Link layer …

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


5 Basic Components of Communication Systems

• Every communication system has 5 basic


requirements
1. Data Source (where the data originates)
2. Transmitter (device used to transmit data)
3. Transmission Medium (cables or non cable)
4. Receiver (device used to receive data)
5. Destination (where the data will be placed)

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


5 Basic Components

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Before going onwards ….Revision

• Classification of Transmission Modes (Serial, Parallel, ….)

• How to synchronize transmission timing between two or more systems ?

• What is Asynchronous and Synchronous Transmission?

• What is Byte Stuffing ?

• What is Bit Stuffing ?

• And some more……………

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Classification of Transmission Modes
• We use the term transmission mode to refer to the manner in which data is sent over the
underlying medium
• Transmission modes can be divided into two fundamental categories:
• Serial
– one bit is sent at a time
– Serial transmission is further categorized according to timing of transmissions
• Parallel
– multiple bits are sent at the same time

20 20
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Serial Transmission

1 0 0 1 1 0 0 1
Sender transmitted Receiver received

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Parallel Transmission
• Each bit has it’s own piece of wire along which it travels often used
to send data to a printer

1
Sender transmitted

Receiver received
0
0
1
1
0
0
1

All bits are sent simultaneously

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


How do we send bits / pulses over wire?

• Serial Mode: 1 bit is sent with each clock tick


– one communication channel / wire is needed
• Parallel Mode: multiple bits are sent with each clock tick
– multiple channels / wires, bundled in one cable, are required
– advantage: n-times faster than serial mode (but this is tricky )
– disadvantage: cost = 8x wires (used only over short distances

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Parallel Transmission

• A parallel mode of transmission has two chief advantages:


– High speed: it can send N bits at the same time
• a parallel interface can operate N times faster than an equivalent serial interface
(Apparently it looks but …………)
– Match to underlying hardware: Internally, computer and communication
hardware uses parallel circuitry
• a parallel interface matches the internal hardware well

• But parallel transmission is slower than serial and


requires higher bandwidth. Further due to
inconsistencies on channels data arrives at
different times
• Parallel transmissions are rarely used anymore

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Serial Transmission

• It may seem that anyone would choose parallel transmission for


high speeds
– However, most communication systems use serial mode

• There are two main reasons


– First, serial networks can be extended over long distances at much less cost
– Second, using only one physical wire means that there is never a timing
problem caused by one wire being slightly longer than another

• Sender and receiver must contain a hardware that converts data


from the parallel form used in the device to the serial form used on
the wire
• Figure 9.3 illustrates the configuration

25 25
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Serial Transmission

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Sped in Parallel Vs Serial Transmission

• When you send in parallel you must measure all of the lines at the exact same
moment, as you go faster the size of the window for that moment gets smaller and
smaller, eventually it can get so small that some of the wires may still be stabilizing
while others are finished before you ran out of time.
• By sending in serial you no longer need to worry about all of the lines stabilizing,
just one line. And it is more cost efficient to make one line stabilize 10 times faster
than to add 10 lines at the same speed.
• Some things like PCI Express do the best of both worlds, they do a parallel set of
serial connections (the 16x port on your motherboard has 16 serial connections). By
doing that each line does not need to be in perfect sync with the other lines, just as
long as the controller at the other end can reorder the "packets" of data as they
come in using the correct order.
• The How Stuff Works page for PCI-Express does a very good explanation in depth
on how PCI Express in serial can be faster than PCI or PCI-X in parallel.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Revision is Over now

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


How to synchronize transmission timing between two
or more systems ?

Also called
Timing Methodology

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


What is Synchronization ???

• The Most fundamental requirements is

synchronization:
– The transmission of a stream of bits from one device to another
across a transmission link involves a great deal of cooperation and
agreement between the two sides.

– One of the most fundamental requirements is synchronization.


• Receiver must know the rate at which bits are being received
so that it can sample the line at appropriate intervals to
determine the value of each received bit.

30
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Timing problems require a mechanism to synchronize the
transmitter and receiver
• Timing problems require a mechanism to synchronize
the transmitter and receiver

• Timing (rate, duration, spacing) of the data bits must be


the same at transmitter & receiver.

• And if clocks not aligned and drifting is there , the receiver


will sample at wrong time after sufficient bits are sent.
• Or we can say that …..sender and receiver clocks may not
run synchronous so that the sampling instant will shift from
the beginning of the signal to the end and may overflow.

McGraw-Hill 2/26
©The McGraw-Hill Companies, Inc., 2000
Two solutions to synchronize clocks
• A fundamental requirement of digital data
communications is that the receiver knows the
starting time andand
Asynchronous theSynchronous
duration of each bit.
Transmission

• Two solutions to synchronizing clocks


• Asynchronous transmission
• Synchronous transmission

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Asynchronous and Synchronous Transmission

33
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Asynchronous transmission
• In asynchronous transmission, each character of data is treated
independently.

• The strategy with this scheme is to avoid the timing problem by


not sending long, uninterrupted streams of bits. Instead, data are
transmitted one character at a time.

• Each character begins with a start bit that alerts the receiver
that a character is arriving. The receiver samples each bit in the
character and then looks for the beginning of the next character.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Asynchronous Transmission

• The beginning of the character is signalled by a start bit


• This is followed by a character of 5 or 8 bits long
• The bits of the character are transmitted beginning with the
least significant bit
• A parity bit is then added for the purpose of error detection
The end of the character is a stop element.

McGraw-Hill 3/26
©The McGraw-Hill Companies, Inc., 2000
Asynchronous transmission

• There can be idle time between each character.


• Slow and inefficient method of data transmission.
• Inexpensive method for low speed transmission.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Asynchronous transmission

This technique would not work well for long blocks of data
because the receiver's clock might eventually drift out (to
move out of a place slowly ) of synchronization with the
transmitter's clock.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Asynchronous transmission
• In asynchronous transmission, each character is transmitted
separately with separate synchronization information.

• This type of transmission is often used in situation when characters


may be generated at random intervals, such as when a user types at
a terminal.

• In asynchronous transmission, all of the bits that comprise a


character are framed and then sent as a single transmission string.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Asynchronous Transmission

McGraw-Hill 4/26
©The McGraw-Hill Companies, Inc., 2000
Asynchronous Transmission

Sometimes called start-stop transmission


Used by the
receiver for Each character is Sent
separating sent independently between
characters
transmissi
and for
synch. ons (a
series of
stop bits)

Used on point-to-point full duplex circuits


(used by Telnet when you connect to Unix/Linux computers)

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


A Note on Asynchronous Transmission

• Burst mode transmission


• In the past, asynchronous transmission referred only to
character by character transmission where each character
contained information about timing etc.
– Note the use of start and stop bits

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Asynchronous Transmission

• Asynchronous transmission is simple and cheap but requires an


overhead of two to three bits per character.

– For example, for an 8-bit character with no parity bit, using a 1-bit-long stop
element, two out of every ten bits convey no information but are there merely
for synchronization; thus the overhead is 20%.

• Of course, the percentage overhead could be reduced by sending


larger blocks of bits between the start bit and stop element.

• However, the larger the block of bits, the greater the cumulative
timing error. To achieve greater efficiency, a different form of
synchronization, known as synchronous
transmission, is used.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Asynchronous File Transfer

• Used on
– Point-to-point asynchronous circuits
– Typically over phone lines via modem
– Computer to computer for transfer of data files

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


• To achieve greater efficiency, a different form of
synchronization is used.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


• To achieve greater efficiency, a different form of
synchronization, known as synchronous
transmission, is used.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Note

In synchronous transmission, we send


bits one after another without start or
stop bits or gaps. It is the responsibility
of the receiver to group the bits.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Synchronous Transmission
• For large blocks, synchronous transmission is
used.
• Each block of data is formatted as a frame that
includes a ‘starting’ and an ‘ending flag’, and is
transmitted in a steady stream without start and
stop codes. The block may be many bits in length.

47
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Synchronous Transmission

• To achieve synchronous transmission, each block begins with a preamble bit pattern
and generally ends with a postamble bit pattern.

• A typical frame format for synchronous transmission starts with a preamble called a
flag, which is 8 bits long. The same flag is used as a postamble.

• This is followed by some number of control fields (containing data link control
protocol information), then a data field (variable length for most protocols), more
control fields, and finally the flag is repeated.

48
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Synchronous Transmission

• For sizable blocks of data, synchronous transmission is


far more efficient than asynchronous.

49
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Comparison of Synchronous versus Asynchronous
Transmissions for Overhead

• In synchronous Transmission ,is a data transfer method in which a


continuous stream of data signals is accompanied by timing signals
(generated by an electronic clock) to ensure that the transmitter and
the receiver are in step (synchronized) with one another. The data is
sent in blocks (called frames or packets) spaced by fixed time intervals.

• In contrast, asynchronous transmission works in spurts and must insert


a start bit before each data character and a stop bit at its termination
to inform the receiver where it begins and ends.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Comparison between Asynchronous and Synchronous

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Comparison of Synchronous versus Asynchronous
Transmissions for Overhead

• Asynchronous transmission
• Synchronous transmission (two start and stop bits for every 8 bit
character, (2/(2+8))*100%=20%).

• Synchronous transmission
• A frame in one of the standard schemes contains 48 bits of
control, preamble, and postamble. Thus, for a 1000 character
block of data, each frame consists of 48 bits of overhead and
1000*8=8000 bits of data, for a percentage overhead of only
(48/(8000+48))*100%=0.6%.

• Result …………….???????

McGraw-Hill 8/26
©The McGraw-Hill Companies, Inc., 2000
Now come to Data Link Layer and its feature of ‘Variable-size framing
‘.…….

• Data link control functions


include
• Framing
• Flow and Error control.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Framing

• We will discuss framing


• or how to organize the bits
that are carried by the
McGraw-Hill physical layer.
©The McGraw-Hill Companies, Inc., 2000
11.1.1 Framing

• Data transmission in the physical layer means moving bits


in the form of a signal from the source to the destination.

• Physical layer provides bit synchronization


– Synchronization ensures that the sender and receiver use the
same bit durations and timing.

– Bit Synchronization will be discussed later….

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


11.1.1 Framing

• Data-link layer needs to pack bits into frames, so that each


frame is distinguishable from another.
• Just an analogy
– Our postal system practices a type of framing.
• Simple act of inserting a letter into an envelope separates one piece of
information from another (Envelope serves as the delimiter).
• Each envelope defines the sender and receiver addresses, (which is
necessary since the postal system is a many to- many carrier facility).

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


11.1.1 Framing

• Framing is the common terminology for packetzing at the data link


layer.
• Different protocols have different names for the packet at the data
link layer.
• The data link layer is responsible for moving data from one hop to
the next.To get to the next hop, the data must pass through a LAN or
a WAN, each of which has its own protocols.
• The packet coming from the IP layer must therefore be encapsulated
in the appropriate packet defined by the data link layer of the
underlying LAN or WAN.
• A header and a trailer are usually added to a packet received from
the network layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


11.1.1 Framing

• Framing in the data-link layer separates a message from


one source to a destination by adding a sender address
and a destination address.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Framing

• Large block of data may be broken up into small frames


at the source because:

– limited buffer size at the receiver

– A larger block of data has higher probability of error


• With smaller frames, errors are detected sooner, and only a smaller amount of
data needs to be retransmitted

– On a shared medium, such as Ethernet and Wireless LAN, small frame


size can prevent one station from occupying medium for long periods

59
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Revision Header , Data Area , Trailer

• A data packet consists of three elements.


1. First element is a header, which contains the information
needed to get the packet from the source to the destination.

2. Second element is a data area, which contains the information


of the user who caused the creation of the packet.

3. Third element of packet is a trailer, which often contains


techniques ensuring that errors do not occur during
transmission

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Fixed size framing and variable size framing

61
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Frame Size

• Frames can be of fixed or variable size.

• In fixed-size framing
– there is no need for defining the boundaries of the frames; the
size itself can be used as a delimiter.
– ATM (Asynchronous Transfer Mode) WAN uses frames of fixed
size called cells.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Frame Size

• Variable-size framing
– the data divided into variable size frames.
– In LAN .
– Need a way to define the end of one frame and the beginning of
the next.
– Two approaches used for this purpose
• a character-oriented approach
• and a bit-oriented approach

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Flag in Variable-size framing

• In Variable-size framing, Flags are necessary to


show the receiver where the beginning and end of
each frame is. Without flags the frames would
never end the data would be largely garbage.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Framing Approaches in Computer Network

• There are mainly three types of framing approaches:


1. Byte-Oriented Framing
• It views the frames as a collection of bytes(8 bits), also known as a
character and hence given the name Character Oriented Approach.
2. Bit-Oriented Framing
• It views the frames as a collection of bits. The data is transmitted as a
sequence of bits that can be interpreted as text and multimedia data in
the upper layer
3. Clock Based Framing
• This framing is mainly used for Optical Networks (such as SDH).
• In this approach, a series of repetitive pulses maintain a constant bit rate
and keep the digital bits aligned in the data stream.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Categorization of Protocols of Data Link layer

• Character-oriented framing protocols:

• Bit-oriented framing protocols:

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Character-oriented framing protocols

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Character-Oriented Protocols

• Frame fields are made up of an integer number of


bytes
• There are three Byte-Oriented Protocols:
– Binary Synchronous Communication Protocol (BISYNC)
– Digital Data Communication Message Protocol (DDCMP)
– Point-to-Point Protocol(PPP).

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Character-Oriented Protocols

• In character-oriented (or byte-oriented) framing, data to be


carried are 8-bit characters from a coding system such as
ASCII .
• The header, which normally carries the source and
destination addresses and other control information, and
the trailer, which carries error detection redundant bits, are
also multiples of 8 bits.
• To separate one frame from the next, an 8-bit (1-byte) flag
is added at the beginning and the end of a frame.
• The flag, composed of protocol-dependent special
characters, signals the start or end of a frame.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Character-Oriented Protocols

• Figure shows the format of a frame in a character-oriented


McGraw-Hill protocol.
©The McGraw-Hill Companies, Inc., 2000
Point-to-Point Protocol(PPP)

• It is a data link layer protocol. It is a wide area


network protocol that runs over internet links. This
protocol is mainly used in broadband
communication that deals with high speed and
heavy loads. The frame format defined is given in
the below figure, along with the bits.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Point-to-Point Protocol(PPP)
 The bit pattern for the flag is 01111110.
 The address field is set to 11111111 in case of broadcast.
 The control value is set to a constant value of 11000000.
 The protocol consists of 1 or 2 bytes that define the type of data in the payload section.
The payload carries the data.
 The maximum length of this field is 1500 bytes.
 The checksum field is used for error detection.
 If the flag bits appear in the payload part, the situation is overcome using character/byte stuffing.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Character-Oriented Protocols

• In character-oriented protocol, we add special


characters (called flag) to distinguish beginning
and end of a frame. Usually flag has 8-bit length

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Character-Oriented Protocols

• Problem in character–oriented protocol


– Pattern used for the flag may also become part of the
data to send. If this happens, the destination node, when
it encounters this pattern in the middle of the data,
assumes it has reached the end of the frame.
– To deal with this problem, a byte stuffing (also
known as character stuffing) approach is included to
character-oriented protocol.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Byte Stuffing

• In byte stuffing a special byte is added to the data part,


this is known as escape character (ESC).
– ‘Escape characters’ have a predefined pattern.
– Receiver removes the escape character and keeps the
data part.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Byte Stuffing

BUT .
•It cause to another problem, if the text contains escape characters
as part of data. To deal with this, an escape character is prefixed with
another escape character. The following figure explains about
character stuffing

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Byte Stuffing

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Byte Stuffing

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Conclusion

• Character-oriented framing was popular when only text


was exchanged by the data-link layers. The flag could be
selected to be any character not used for text
communication.

• When we send other types of information such as graphs,


audio, and video;
– Any character used for the flag could also be part of the
information. If this happens, the receiver, when it encounters this
pattern in the middle of the data, thinks it has reached the end of
the frame. To fix this problem, a byte-stuffing strategy was added
to character-oriented framing.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Bit Stuffing

80
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Bit -Oriented Protocols

• Frames are interpreted as a sequence of bits

• In bit oriented protocols, a frame is a collection of bits,


organized in fields – typically an address field, a control
field, a data field and a Frame Check Sequence (FCS) field
for error detection

• Example: High-Level Data Link Control (HDLC)


– It is the simplest WAN Protocol that can connect your
remote offices over leased lines

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Bit -Oriented Protocols
• Beginning and Ending Sequence: The 8 bits added at the start and end of the frame in this protocol are 01111110.
These bits are also transmitted when the link is idle to synchronize the clock. 
• Cyclic Redundancy Check(CRC): It is used to detect errors.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Bit -Oriented Protocols

• There can be a problem of Framing Error we mentioned earlier.


• The solution to this problem is Bit-Stuffing. 
• Let’s discuss an example with the HDLC protocol and understand how it
solves this problem.
• Consider the frame to be sent and received by the devices
be 011111100101000111111001111110 again if you notice that this
frame contains a part similar to the beginning in its body.
• In Bit Stuffing, whenever the sender device finds the frame consisting of
five consecutive 1’s, it will stuff a ‘0’ bit. It will look like this
0111111001010001111101001111110. When the receiving device
receives this frame and encounters a ‘0’ after five consecutive bits, it will
remove it to maintain the original frame.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Bit Stuffing

• In bit-oriented framing, the data section of a frame is a sequence


of bits to be interpreted by the upper layer as text, graphic,
audio, video, and so on.

• In addition to headers (and possible trailers), we still


need a delimiter to separate one frame from the other.

• Most protocols use a special 8-bit pattern flag, 01111110, as the


delimiter to define the beginning and the end of the frame, as
shown in Figure

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Bit Stuffing

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Bit Stuffing

• Problem Created by Flag


– This flag can create the same type of problem we saw in the
character-oriented protocols.
– That is, if the flag pattern appears in the data, we need to
somehow inform the receiver that this is not the end of the
frame.
• Remedial measure
– We do this by stuffing 1 single bit (instead of 1 byte) to
prevent the pattern from looking like a flag. The strategy is
called bit stuffing.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Bit Stuffing

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Bit Stuffing

• bit stuffing (also known—uncommonly—as positive


justification) is the insertion of non-information
bits into data.
• Stuffed bits should not be confused with overhead
bits.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Bit Stuffing

• Two main reasons for Bit stuffing (by many network and
communications protocols ):
1. To prevent data being interpreted as control information.
• In a bit-oriented protocol, the data to send is a series of bits.
• In order to distinguish frames, most protocols use a bit pattern of 8-bit length
(01111110) as flag at the beginning and end of each frame.
• This also causes the problem of appearance of flag in the data part .To deal with
this an extra bit added. This method is called bit stuffing. In bit stuffing, if a 0 and
five successive 1 bits are encountered, an extra 0 is added. The receiver node
removes the extra-added zero.

2. Further , For protocols that require a fixed-size frame, bits are


sometimes inserted to make the frame size equal to this set size.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Bit Stuffing

• Example:

Data bits

Transmitted bits
with stuffing

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Bit Stuffing (3)

• So how does it compare with byte stuffing?

Data bits

Transmitted bits
with stuffing

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Bit Stuffing (3)

• So how does it compare with byte stuffing?

Data bits

Transmitted bits
with stuffing

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Bit Stuffing

Bit stuffing does not ensure that the payload is intact


(i.e. not corrupted by transmission errors); it is
merely a way of attempting to ensure that the
transmission starts and ends at the correct places

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Bit Stuffing

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Important Note

• A protocol which guarantees the receiver of synchronous data can recover the
sender's clock. When the data stream sent contains a large number of adjacent
bits which cause no transition of the signal, the receiver cannot adjust its clock to
maintain proper synchronised reception.

• To eliminate the possibility of such a pathological case, when a preset number of


transitionless bits have been transmitted, a bit which does cause a transition is
"stuffed" (transmitted) by the sender.

• The receiver follows the same protocol and removes the stuffed bit after the
specified number of transitionless bits, but can use the stuffed bit to recover the
sender's clock.

96
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Summary

• Problem: it is possible that the flag byte’s bit pattern occur in the
data
• Two popular solutions:

– Byte stuffing
• The sender inserts a special byte (e.g., ESC) just before each “accidental” flag byte
in the data.
• The receiver’s link layer removes this special byte before the data are given to the
network layer.

– Bit stuffing: each frame starts with a flag byte “01111110”. {Note this is
7E in hex}
• Whenever the sender encounters five consecutive 1s in the data, it automatically
stuffs a 0 bit into the outgoing bit stream.
• When the receiver sees five consecutive incoming 1 bits, followed by a 0 bit, it
automatically deletes / de-stuffs the 0 bit.

97
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Summary

Simply, Bit stuffing is the


process of adding one extra 0
whenever five consecutive 1s
follow a 0 in the data.
Byte stuffing is the method of
adding 1 extra byte if there is a
flag or escape character in the
text

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Conclusion
• Frame synchronization
– The Media Access Control sublayer also determines
where one frame of data ends and the next one starts
– frame synchronization
• Hierarchy of synchronization tasks:
– There exists a hierarchy of synchronization tasks:
• Character or byte level : recognizing the start and end of
each character (or small unit of data)
• Bit level : recognizing the start and end of each bit
• Block or message level : recognize the start and end of each
large unit of data (in networks this is a frame).
99
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Some Data Link Protocols and protocols for synchronous
transmission

1. High-Level Data Link Control (HDLC) Frame


Structure
2. Ethernet (IEEE 802.3)
3. Token Ring (IEEE 802.5)
4. Serial Line Internet Protocol (SLIP)
5. Point-to-Point Protocol(PPP)

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


1. High-Level Data Link Control (HDLC)

• The OSI’s data link protocol


• A bit-oriented protocol
• On transmitting side, HDLC receives data from an application, and
delivers it to the receiver on the other side of the link
• On the receiving side, HDLC accepts the data and delivers it to the
higher level application layer
• Both modules exchange control information, encoded into a frame

(IBM’s SDLC has similar features and the format of HDLC)

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


1. HDLC frame types

HDLC is a group of data link (Layer 2) protocols used to transmit


synchronous
McGraw-Hill data packets between point-to-point
©The McGraw-Hillnodes
Companies, Inc., 2004
1. HDLC Frame Structure

• Flag: 01111110, at start • Control: purpose or


and end function of frame
• Address: secondary – Information frames: contain
station (for multidrop user data
– Supervisory frames:
configurations)
flow/error control
• Information: the data to (ACK/ARQ)
be transmitted – Unnumbered frames:
• Frame check sequence: variety of control functions
16- or 32-bit CRC

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


1. HDLC Frame Structure

• The problem of transparency


– Because HDLC uses 01111110 to mark the start and end
of a packet, the character “01111110” will confuse the
receiver.
• Solution - Bit Stuffing
– Add a 0 after every five 1s at sender side and delete the
0 at receiver side.

104
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
2. Ethernet (IEEE 802.3)

Ethernet (IEEE 802.3) was conceived by Bob Metcalfe in


1973 and developed jointly by Digital, Intel, and Xerox in
the 1970s.
• It is a byte-count protocol. Therefore, Ethernet has no transparency
problem because it does not use number of bytes to delineate the
message.
• It uses contention media access control.
• The address is 6-byte
• The maximum length of the message is 1492 bytes.
• CRC-32 frame check.

105
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
2. Ethernet (IEEE 802.3)

Destination Source address Length Message CRC-32


address 6 bytes 2 bytes variable 4 bytes
6 bytes

Frame Formats

Ethernet, IEEE 802.3, is one of the most widely used standards


for computer networking and general data communications. It is
widely used in all forms of data networking from connecting to
home Wi-Fi hubs to business data networks and
telecommunications
McGraw-Hill
networking. 106
©The McGraw-Hill Companies, Inc., 2000
3. Token Ring (IEEE 802.5)

• It was developed by IBM in the early 1980s, and later


became a formal standard of the IEEE. It uses a controlled
access media access protocol.
• It is a byte-oriented protocol
• Does not suffer the same transparency problems as SDLC
– Each token ring frame starts and ends with special electrical signal
produced in a manner different from any other pattern of bits.
• The size of the message field is generally limited to 4500 bytes
• The frame check sequence is 32-bit CRC code.

Token Ring is a computer networking technology used to build


107
local area networks
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
3. Token Ring (IEEE 802.5)

Token Ring (IEEE802.5) format

Start Frame Destination Source Message End


delimiter control address address variable delimiter

Access control Frame check sequence


1 byte 4 bytes

108
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
4. Serial Line Internet Protocol (SLIP)

• It is a byte-oriented protocol designed to connect two computers


using Internet protocols over a point-to-point telephone line. It is
developed in 1980s.

– SLIP suffers the transparency problem because it uses “11000000” as END.


So, it replaces the character in the message with “11011001” (ESC) +
“11011100”. This trick is also used for ESC character itself, with a ESC +
“11011101”.

– Compressed SLIP (CSLIP) uses compression to reduce the amount of data


transmitted.

109
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
4. Serial Line Internet Protocol (SLIP)

SLIP packet layout

End Message End


1 byte variable 1 byte

• SLIP is an encapsulation of the Internet


• On personal computers, SLIP has largely been replaced by the
Point-to-Point Protocol (PPP), which is better engineered, has
more features.
• On microcontrollers, however, SLIP is still the preferred way of
encapsulating IP packets, due to its very small
McGraw-Hill overhead.
©The McGraw-Hill
110
Companies, Inc., 2000
5. Point-to-Point Protocol (PPP)

• is a byte-oriented protocol developed in 1990s as a


replacement for SLIP.
– The packet begins and ends with a flag “01111110”. Therefore, it
suffers the transparency problem.
– CRC-16 for error control
– Supports network layer protocols other than just Internet
protocol.
– Message length is up to 1500 bytes.

111
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
5. Point-to-Point Protocol (PPP)

• PPP is a data link protocol commonly used in establishing


a direct connection between two networking nodes and has largely
superseded the older Serial Line Internet Protocol (SLIP) and other
standards.
• It can provide connection authentication, transmission encryption,
and compression

PPP packet layout

Flag Address Control Message CRC-16 Flag


1 byte 1 byte 1 byte variable 2 bytes 1 byte

112
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Flow and Error Control (Just a revision )

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Flow and Error Control

• Whenever an entity produces items and another entity


consumes them, there should be a balance between
production and consumption rates.

• If the items are produced faster than they can be


consumed, the consumer can be overwhelmed and may
need to discard some items.

• If the items are produced more slowly than they can be


consumed, the consumer must wait, and the system
becomes less efficient.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Flow and Error Control

• Flow control in this case can be feedback from the receiving node to
the sending node to stop or slow down pushing frames.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Flow and Error Control

• Buffers
– Flow control can be implemented in several way
– One of the solutions is normally to use two buffers
• one at the sending data-link layer and the other at the receiving data-link
layer.
– A buffer is a set of memory locations that can hold packets at the
sender and receiver.
– The flow control communication can occur by sending signals
from the consumer to the producer.
– When the buffer of the receiving data-link layer is full, it informs
the sending data-link layer to stop pushing frames.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Error Control

• Error control at the data-link layer is normally very simple and


implemented using one of the following two methods.
• In both methods, a CRC is added to the frame header by the sender
and checked by the receiver.

• In the first method, if the frame is corrupted, it is silently discarded; if it is not


corrupted, the packet is delivered to the network layer. This method is used
mostly in wired LANs such as Ethernet.
• In the second method, if the frame is corrupted, it is silently discarded; if it is
not corrupted, an acknowledgment is sent (for the purpose of both flow and
error control) to the sender

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Combination of Flow and Error Control

• Flow and error control can be combined.


• In a simple situation, the acknowledgment that is sent for
flow control can also be used for error control to tell the
sender the packet has arrived uncorrupted.
• Lack of acknowledgment means that there is a problem in
the sent frame (Will be discussed later)
• A frame that carries an acknowledgment is normally called
an ACK to distinguish it from the data frame.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Connectionless and Connection-Oriented

• In a connectionless protocol
– Frames are sent from one node to the next without any
relationship between the frames; each frame is independent.
– Note that the term connectionless here does not mean that there
is no physical connection (transmission medium) between the
nodes; it means that there is no connection between frames.
– The frames are not numbered and there is no sense of ordering.
– Most of the data-link protocols for LANs are connectionless
protocols.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Connectionless and Connection-Oriented

• In a connection-oriented protocol
– A logical connection should first be established between the two
nodes (setup phase).
– After all frames that are somehow related to each other are
transmitted (transfer phase), the logical connection is terminated
(teardown phase).
– Connection oriented protocols are rare in wired LANs, but we can
see them in some point-to-point protocols, some wireless LANs,
and some WANs.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


DATA-LINK LAYER PROTOCOLS

• Traditionally four protocols have been defined for the data-link layer
to deal with flow and error control:
– Simple
– Stop-and-Wait
– Go-Back-N
– Selective-Repeat.
• Although the first two protocols still are used at the data-link layer,
the last two have disappeared.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Note

• A transport-layer protocol can provide two types of services:


– Connectionless
– and connection-oriented.
• In a connectionless service, the sender sends packets to the receiver without any
connection establishment.
• In a connection-oriented service, the client and the server first need to establish a
connection between themselves.
• The Stop-and-Wait protocol provides both flow and error control, but is inefficient.
• The Go-Back-N protocol is the more efficient version of the Stop-and-Wait protocol
and takes advantage of pipelining.
• The Selective-Repeat protocol, a modification of the Go-Back-N protocol, is better
suited to handle packet loss.
• All of these protocols can be implemented bidirectionally using piggybacking.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Data Link Control (DLC) Sub Layer

Finished

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


As we already know

• Data-link layer is divided into two sublayers.


• Upper sublayer_ Data-link Control (DLC)
• Lower sublayer_Multiple access control (MAC)

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Now we are going to discuss
Medium Access control SubLayer

McGraw-Hill Related Chapter _12


©The McGraw-Hill Companies, Inc., 2000
Medium Access Control

• When computers use a shared medium(cable or air), there must be a


method to control access to the medium at any moment.

• If there is no rule to specify which vehicle has the right-of-way, there


may be a conflict or even a collision.

• To prevent this conflict or collision on a network, there is a need for


a medium access control(MAC) method.

• The use of a regulated method ensures that there is no conflict


among the station.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS

Channel
Partitioning



 (In the last)


McGraw-Hill
ALOHA

©The McGraw-Hill Companies, Inc., 2000


A. Random Access Protocols

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS



 (Now)


McGraw-Hill
ALOHA

©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS

RANDOM ACCESS (or contention methods )


 Superiority: No controller
 Permission: No need of permission
 State of the medium: Idle or busy
 Transmission :
A. Every station has the equal right to transmit
B. Non-scheduled
C. Random

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Random Access

• To avoid access conflict or to resolve it when it does


happen, each station follow certain steps to access the
medium:

1. The station checks to make sure the medium is idle. This is called carrier
sense. This is analogous to the rules in an assembly. If a person wants to
speak, he must first listen to make sure no one else is talking.
2. If the medium is idle, the station can send data.
3. Even through steps 1and steps 2 are followed, there is still a potential for
collision.
• For example: two stations may be checking the medium at the same time;
neither senses that the medium is in use and both send at the same time.
• To avoid collision the sending stations can make a reservation for use of
the medium.
• To detect collision(and send the data again),the station need to continue
monitoring the medium.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Data Collision
• A  data  collision  is  the  simultaneous  presence  of signals
from two nodes on the network.

• A collision can occur when two nodes each think the


network is idle and both start transmitting at the same
time. Both packets involved in a collision are broken into
fragments and must be retransmitted.

• In an Ethernet network, a collision is the result of two


devices on the same Ethernet network attempting to
transmit data at exactly the same time. The network
detects the "collision" of the two transmitted packets and
discards them both.
132
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Data Collision
• Two methods of resolving the collision problem:

– Collision Detection (Carrier Sense Multiple Access - Collision


Detection (CSMA/CD)

– Collision Avoidance (Carrier Sense Multiple Access - Collision


Avoidance (CSMA/CA)

133
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Data Collision
• Ethernet uses CSMA/CD as its method of allowing devices to "take
turns" using the signal carrier line.

• When a device wants to transmit, it checks the signal level of the line
to determine whether someone else is already using it.
– If it is already in use, the device waits and, perhaps in a few seconds.
– If it isn't in use, the device transmits.

• However, two devices can transmit at the same time in which case a
collision occurs and both devices detect it.

• Each device then waits a random amount of time and retries until
successful in getting the transmission sent.

134
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Carrier Sense Multiple Access - Collision Detection (CSMA/CD)

• Method is used almost exclusively on star and bus topology


networks eg. Ethernet

• Based on a half-duplex protocol

• Only one workstation can transmit at a time.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Carrier Sense Multiple Access - Collision Detection (CSMA/CD)

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Carrier Sense Multiple Access - Collision Detection (CSMA/CD)

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Carrier Sense Multiple Access - Collision Detection (CSMA/CD)

• To detect if a collision occurs


– a workstation listens its own transmission as data is being
transmitted
– a workstation should only hear its own data being transmitted.

• If there is a collision
– the data transmission will be corrupted

• To ensure the collision is clearly recognized


– a station detecting a collision will send a jamming signal to all
stations on the network.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Carrier Sense Multiple Access - Collision Detection (CSMA/CD)

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Carrier Sense Multiple Access - Collision Detection (CSMA/CD)

• Collision Detection Problems:

– as concurrent users increase, the number of collisions increase

– lots of retransmission during peak times

– Reduce throughput on the network

– stations have to wait for a collision to take place and then solve
the problem.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Carrier Sense Multiple Access - Collision Avoidance (CSMA/CA)

• Prevents collisions

• Station must gain permission before transmitting.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Token passing in CSMA/CA
• A token is passed from station to station

• Used in token ring networks

• Token passing ensures that only one station can transmit at any one
time

• A station needs to get an empty token before it can transmit


– – a station inserts a message into the token
– – then sends the token on to its destination address

• There should only ever be one token in circulation on the network.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Token passing in CSMA/CA
• Token contains data in a packet (data, source address and destination
address)

• Each station checks an incoming packet’s destination address

• When packet arrives at its destination, it is copied into a buffer and


modified to indicate acceptance

• Then the token (still containing the data) is passed on round the loop
until it returns to the sender.

• The sender is responsible for removing the data from the token and
passing the empty token on to the next station.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Token passing in CSMA/CA
• Disadvantages:

– complexity of the software needed to maintain token passing


– excessive overheads can reduce performance of the network

• Problems:

– What happens when a token disappears? (ie. a station fails and so


does not forward a token)

– If a token disappears, who generates a new token?

– Is it possible for there to be two or more tokens on a ring?

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Comparison of methods
• CSMA/CD
– simple protocol
– high transmission speed (up to 1000 Mbps)
– as traffic increases, collisions increase
• re-transmissions increase
– non-deterministic
• it is not possible to determine exactly when a workstation will be able to transmit
without a collision

• Token-passing
– performs well under heavy loads
– slower transmission speed (up to 100 Mbps)
– suitable for applications that require uniform response times
– complex software is required
– more expensive to implement.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Note:

Token passing is used mostly by local


area networks (LANs).

CSMA/CD is used in the Ethernet


LAN.
CSMA/CA is used in the wireless
LANs.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


B. Controlled Access Protocols

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS

CONTROLLED ACCESS:
 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.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS
CONTROLLED ACCESS

Three popular controlled-access methods

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


1. Reservation method

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS
CONTROLLED ACCESS

Reservation method
Reserve then send

 In the reservation method, a station needs to make a


reservation before sending data.
 Time is divided into intervals.
 In each interval, a reservation frame precedes the data
frames sent in that interval.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS
CONTROLLED ACCESS

Reservation method
 If there are N stations in the system, there are exactly N
reservation mini-slots in the reservation frame.

 Each mini-slot belongs to a station.

 When a station needs to send a data frame, it makes a


reservation in its own mini-slot.

 The stations that have made reservations can send their data
frames after the reservation frame.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CONTROLLED ACCESS Reservation method

 Figure below shows a situation with five stations and a five-


mini-slot reservation frame.
 In the first interval, only stations 1, 3, and 4 have made
reservations.
 In the second interval, only station 1 has made a
reservation.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


2. Polling method

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CONTROLLED ACCESS Polling

 Polling works with topologies in which one device is


designated as a primary station and the other devices are
secondary stations.

 All data exchanges must be made through the primary device even
when the ultimate destination is a secondary device.

 The primary device controls the link.


 The secondary devices follow its instructions.

 It is up to the primary device to determine which device is


allowed to use the channel at a given time.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CONTROLLED ACCESS Polling

 The primary device is always the initiator of a session.


Poll
 If the primary wants to receive data, it asks the secondary
devices if they have anything to send; this is called poll
function.
Select
 If the primary wants to send data, it tells the secondary to get
ready to receive; this is called select function.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CONTROLLED ACCESS Polling

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CONTROLLED ACCESS Polling

Select
 The select function is used whenever the primary device
has something to send.
 If the primary is neither sending nor receiving data, it
knows the link is available.
 If it has something to send, the primary device sends it.
 The primary must alert the secondary to the upcoming
transmission and wait for an acknowledgment of the
secondary’s ready status.
 Before sending data, the primary creates and transmits
a select (SEL) frame, one field of which includes the
address of the intended secondary.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CONTROLLED ACCESS Polling

Poll

 The poll function is used by the primary device to solicit (ask) transmissions
from the secondary devices.

 When the primary is ready to receive data, it must ask (poll) each device in
turn if it has anything to send.

 When the first secondary is approached, it responds either with a NAK frame
if it has nothing to send or with data (in the form of a data frame) if it does.

 If the response is negative (a NAK frame), then the primary polls the next
secondary in the same manner until it finds one with data to send.

 When the response is positive (a data frame), the primary reads the frame
and returns an acknowledgment (ACK frame), verifying its receipt.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
3. Token Passing

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CONTROLLED ACCESS Token Passing

 In this method, the stations in a network are organized in a


logical ring.
 For each station, there is a prede-cessor and a successor.
 Predecessor: The station before the current station in the ring.
 Successor: The station after the current station in the ring.

 The current station is the one that is accessing the


channel now.
 The right to this access has been passed from the predecessor to
the current station.
 The right will be passed to the successor when the current station
has no more data to send.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CONTROLLED ACCESS Token Passing
How is the right to access the channel passed from one station to
another?
 In this method, a special packet called a token circulates through the
ring.
 The possession of the token gives the station the right to access the
channel and send its data.
 When a station has some data to send, it waits until it receives the token
from its predecessor.
 It then holds the token and sends its data.
 When the station has no more data to send, it releases the token,
passing it to the next logical station in the ring.
 The station cannot send data until it receives the token again in the next
round.
 In this process, when a station receives the token and has no data to
send, it just passes the token to the next station.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CONTROLLED ACCESS Token Passing

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CONTROLLED ACCESS Token Passing

Token-passing procedure

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Note:

The poll/select method is mostly used


in time-sharing systems when a central
computer is used to control other
computers.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Token passing network

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CONTROLLED ACCESS Token Passing

Logical Ring
 In a token-passing network, stations do not have to be physically
connected in a ring; the ring can be a logical one. Figure below shows
four different physical topologies that can create a logical ring.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Token Management

• Token management is needed for this access method. Stations must


be limited in the time they can have possession of the token.

• The token must be monitored to ensure it has not been lost or


destroyed..

• Token management is to assign priorities to the stations and to the


types of data being transmitted.

• Token management is needed to make low-priority stations release


the token to high priority stations.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CONTROLLED ACCESS Token Passing

a) Physical ring topology:


 The physical ring topology, when a station sends the token to its
successor, the token cannot be seen by other stations; the successor
is the next one in line. This means that the token does not have to
have the address of the next successor.
 The problem with this topology is that if one of the links-the medium
between two adjacent stations fails,the whole system fails..
 The problem with this topology is that if one of the links--the medium
between two adjacent stations--fails, the whole system fails.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CONTROLLED ACCESS Token Passing

b) Dual ring topology:


 It uses a second (auxiliary) ring which operates in the reverse direction
compared with the main ring.
 The second ring is for emergencies only.
 If one of the links in the main ring fails, the system automatically
combines the two rings to form a temporary ring.
 After the failed link is restored, the auxiliary ring becomes idle again.
 Note that for this topology to work, each station needs to have two
transmitter ports and two receiver ports.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CONTROLLED ACCESS Token Passing

c) Bus ring topology (token bus):


 The stations are connected to a single cable called a bus.
 They, however, make a logical ring, because each station knows the
address of its successor (and also predecessor for token management
purposes).
 When a station has finished sending its data, it releases the token and
inserts the address of its successor in the token.
 Only the station with the address matching the destination address of
the token gets the token to access the shared media.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CONTROLLED ACCESS Token Passing

d) Star ring topology:


 The physical topology is a star.
 There is a hub that acts as the connector.
 The wiring inside the hub makes the ring; the stations are connected
to this ring.
 This topology makes the network less prone to failure because if a link
goes down, it will be bypassed by the hub and the rest of the stations
can operate.
 Also adding and removing stations from the ring is easier.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


C. CHANNELIZATION / CHANNEL PARTIONING

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS
CHANNELIZATION / CHANNEL
PARTIONING
 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.

Channel Partitioning
• Divide channel into
smaller “pieces” (time
slots, frequency, code)
• Allocate piece to node
for exclusive use
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Media Access Control
PROTOCOLS
CHANNELIZATION

Frequency-Division Multiple Access (FDMA)

 In FDMA, the available bandwidth is divided into frequency


bands.
 Each station is allocated a band to send its data. Each
band is reserved for a specific station, and it belongs to the
station all the time.
 To prevent station interferences, the allocated bands are
separated from one another by small guard bands.

In FDMA, the bandwidth is divided into channels.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CHANNELIZATION Frequency-Division Multiple Access

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS
CHANNELIZATION

Time-Division Multiple Access (TDMA)

 In TDMA, the stations share the bandwidth of the channel


in time.
 Each station is allocated a time slot during which it can
send data.
 Each station transmits its data in its assigned time slot.

In TDMA, bandwidth is just one channel that is timeshared.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CHANNELIZATION Time-Division Multiple Access

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CHANNELIZATION Time-Division Multiple Access

 The main problem with TDMA lies in achieving


synchronization between the different stations.
 Each station needs to know the beginning of its slot and
the location of its slot.
 This may be difficult because of propagation delays
introduced in the system if the stations are spread over a
large area.
 To compensate for the delays, we can insert guard times.

 Synchronization is normally accomplished by having some


synchronization bits (normally referred to as preamble
bits) at the beginning of each slot.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Channel Partitioning MAC protocols: TDMA

TDMA: time division multiple access


• access to channel in "rounds"
• each station gets fixed length slot (length = pkt trans time)
in each round
• unused slots go idle
• example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6 idle

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CHANNELIZATION Code-Division Multiple Access

 CDMA differs from FDMA because only one channel


occupies the entire bandwidth of the link.

 It differs from TDMA because all stations can send data


simultaneously; there is no timesharing.

In CDMA, one channel carries all transmissions simultaneously.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Media Access Control
PROTOCOLS CHANNELIZATION Code-Division Multiple Access

Analogy
 CDMA simply means communication with different codes.

 Example:
 In a large room with many people, two people can talk in English if
nobody else understands English.

 Another two people can talk in Chinese if they are the only ones
who understand Chinese, and so on.

 The common channel, the space of the room in this case, can
easily allow communication between several couples, but in
different languages (codes).

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Thanks

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

You might also like