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

The Datalink & The Mac (Medium Access) Sublayer

The document discusses framing, error control, and error detection techniques at the data link layer. It covers: 1) Framing involves breaking up the bit stream into discrete frames and includes techniques like character counting, character stuffing using start/end characters, and bit stuffing using start/end flags. 2) Error control ensures frames are delivered to the destination in the proper order. Error detection techniques like vertical redundancy check (VRC) and cyclic redundancy check (CRC) are used to detect errors without correction. 3) Hamming codes provide error detection and correction. Method A involves numbering bits from left to right and computing checkbits based on position. Validation uses modulo addition to check for errors
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

The Datalink & The Mac (Medium Access) Sublayer

The document discusses framing, error control, and error detection techniques at the data link layer. It covers: 1) Framing involves breaking up the bit stream into discrete frames and includes techniques like character counting, character stuffing using start/end characters, and bit stuffing using start/end flags. 2) Error control ensures frames are delivered to the destination in the proper order. Error detection techniques like vertical redundancy check (VRC) and cyclic redundancy check (CRC) are used to detect errors without correction. 3) Hamming codes provide error detection and correction. Method A involves numbering bits from left to right and computing checkbits based on position. Validation uses modulo addition to check for errors
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 69

Module 3 :

The DATALINK & the MAC


(Medium Access) Sublayer
The Datalink Layer
• deals with the algorithms for achieving reliable, efficient
communication between two adjacent machines
(physically connected) wherein it makes sure that the
bits are delivered exactly the same order in which they
are sent
• Design Issues
– Provides Services to the Network Layer
• Unacknowledged connectionless service
• Acknowledged connectionless service
• Acknowledged connection-oriented service
– Framing
– Error Control
– Flow Control
Framing
• - breaks up the bit stream, given by the physical
layer, into discrete frames and checks the
checksum of each frame
• Methods of Framing
• Character Count
– consider figure 3-3
– no solution for the problem of resynchronization
• b. Character Stuffing (starting & ending characters)
– each frame starts with the ASCII character sequence DLE STX
(Data link Escape start of Text) & ends with DLE ETX (Data link
Escape End of Text)
– consider figure 3-4
Framing
• character stuffing - data link layer on the receiving end
removes the (stuffed) DLE before it gives it to the network
layer
– a major disadvantage is that it is tied up with 8-bit character
representation and the ASCII code in particular
• Bit Stuffing (starting & ending flags)
– allows arbitrary number of bits per character
– each frame begins and ends with an arbitrary bit pattern called
flag byte wherein when it sees 5 consecutive ones in the data,
it automatically stuffs a 0 bit to the outgoing bit stream
– consider figure 3-5
– bit stuffing - analogous to character stuffing
• d. Physical layer coding violations
– applies only to networks in which the encoding on the physical
medium contains redundancy
– usually data is encoded using a pair of bits for a single bit( 1 -
high low pair ; 0 - low high pair; otherwise it will not be
considered as data but as a bit boundary)
Error Control
• makes sure that all frames are eventually
delivered to the network layer at the destination
and in the proper order (exception :
unacknowledged connectionless service)
• Categories
• Error Detection
– Has the capability of determining whether a transmitted frame
is VALID but doesn’t correct errors on the frame
– Can only be corrected thru retransmission (not absolute)
• Error Detection & Correction
– Detects errors and corrects them w/o retransmission
Error Detection Codes
• Vertical Redundancy Check (VRC)
– ASCII representation of DATA (7 bits)
– Check bit to validate (1 bit)
– ODD or EVEN parity can be applied on the
checkbit
• ODD PARITY
– If total number of 1 bits on the DATA is ODD, the value
of the checkbit is 0, otherwise 1
• EVEN PARITY
– If total number of 1 bits on the DATA is EVEN, the value
of the checkbit is 0, otherwise 1
Error Detection Codes (VRC)

• Example
– Consider the character ‘C’
– ASCII equivalent is 67
– Converted to binary -> 1000011
– If odd parity is used : value of checkbit is ???
– Value of the transmitted frame:
10000110
-VALIDATION on the DESTINATION MACHINE
Longitudinal Redundancy Check
(LRC)
• Steps almost similar to VRC except that
LRC is applied to a group of characters
• Example
CHECKBIT(VRC)
S (82) - 1010010 0
L (76) - 1001100 0
U (84) - 1010100 0
CHECKBIT(LRC)- 1001010 0
Cyclic Redundancy Check

• widespread method in detecting error


• Steps
• a. A generator polynomial, G(x) is agreed upon by
both sender and receiver of the frame
• b. Divide the bit string w/ G(x) using modulo 2
division
• c. Subtract the remainder using modulo 2
subtraction. The result is the checksummed frame
to be transmitted
Cyclic Redundancy Check

• Example of modulo 2 addition/ subtraction :


(uses the exclusive - OR)
10101101
+/- 11110001
01011100
• - consider example shown in figure 3-7
Error Detection & Correction :
Hamming Codes
• 3 Methods
• HAMMING CODE METHOD A (HCA)
• HAMMING CODE METHOD B (HCB)
• HAMMING CODE METHOD C (HCC)
• General Properties
• ASCII representation used for DATA
• Involves 11 bits in the representation which
corresponds to one frame
• There are 4 checkbits positioned at the powers of
2 position
Hamming Code Method A (HCA)
• Bits are numbered from the left towards the
right (1 to 11)
• Data is first converted to its ASCII binary
equivalent and each bit is assigned a position at
the NON power of 2 position in the
representation starting with the leftmost bit
• Checkbits are computed by using modulo
addition taking into consideration the binary
value of the position having a value of 1
• the result of the modulo addition will determine
the values of the checkbits
Hamming Code Method A (HCA)

• Example : ‘G’
G -> 71 (ASCII equivalent)
1000111 (binary equivalent)
Position : 1 2 3 4 5 6 7 8 9 10 11
1 0 0 0 1 1 1
Compute for values of checkbits using the
position of bits having a value of 1 (3, 9, 10 & 11)
Convert them (position in base ten) to its binary
equivalent and get the CORRESPONDING RESULT
using MODULO ADDITION
Hamming Code Method A (HCA)

• Continuation….
3 - 0011
9 - 1001
10 - 1010
11 - 1011
---------
Result 1011
(value of each checkbit starting with checkbit 8)
Checkbits: 1 – value is 1 2 – value is 1
4 – value is 0 8 – value is 1
Hamming Code Method A (HCA)

• VALUE OF THE TRANSMITTED FRAME


Position : 1 2 3 4 5 6 7 8 9 10 11
1 1 1 0 0 0 0 1 1 1 1
• VALIDATION(checking) done in the
DESTINATION MACHINE
• Use modulo addition for all (checkbit & non-
checkbit) positions (represented in binary)
• If the result is :
– ZERO -> the frame is valid
– Not zero -> the value of the result converted to decimal
is the position of the error bit
Hamming Code Method A (HCA)
• Continuation(validation)…
– Example :
• Value of the transmitted frame : 1 1 1 0 0 0 0 1 1 1 1
• Consider all positions with a value of 1 (1,2,3,8,9,10,11)
• Modulo addition
1 - 0001
2 - 0010
3 - 0011
8 - 1000
9 - 1001
10 - 1010
11 - 1011
---------
result 0 0 0 0 (no error)
Hamming Code Method A (HCC)

• Similar with Hamming Code Method A


except that bits are numbered from the
right towards the left (1 to 11)
• Distribution of bits(non-checkbit) would
still be from the left towards the right
• Computation of checkbits as well as
validation is similar with HCA
Hamming Code Method A (HCC)

• Example : ‘E’
E -> 69 (ASCII equivalent)
1000101 (binary equivalent)
Position : 11 10 9 8 7 6 5 4 3 2 1
1 0 0 0 1 0 1
Compute for values of checkbits using the
position of bits having a value of 1 (3, 6 & 11)
Convert them (position in base ten) to its binary
equivalent and get the CORRESPONDING RESULT
using MODULO ADDITION
Hamming Code Method A (HCC)

• Continuation….
3 - 0011
6 - 0110
11 - 1011
---------
Result 1110
(value of each checkbit starting with checkbit 8)
Checkbits: 1 – value is 0 2 – value is 1
4 – value is 1 8 – value is 1
Hamming Code Method A (HCC)

• VALUE OF THE TRANSMITTED FRAME


Position : 11 10 9 8 7 6 5 4 3 2 1
1 0 0 1 0 1 0 1 1 1 0
• VALIDATION(checking) done in the
DESTINATION MACHINE
• Use modulo addition for all (checkbit & non-
checkbit) positions (represented in binary)
• If the result is :
– ZERO -> the frame is valid
– Not zero -> the value of the result converted to decimal
is the position of the error bit
Hamming Code Method A (HCC)
• Continuation(validation)…
– Example :
• Value of the transmitted frame : 1 0 0 1 0 1 0 1 1 1 0
• Consider all positions with a value of 1 (2,3,4,6,8,11)
• Modulo addition
2- 0010
3- 0011
4- 0100
6- 0110
8- 1000
11 - 1011
---------
result 0 0 0 0 (no error)
Hamming Code Method A (HCB)
• Bits are numbered from the left towards the right
• Checkbits are computed by representing each NON-
CHECKBIT as a summation using numbers belonging to
the power of 2 (1, 2, 4, 8)
• The value of each checkbit can be obtained by
considering all non-checkbit positions that has its value
on the summed representation and applying a PARITY
BIT (on our case : EVEN PARITY)
• Validation of frame involves comparison of transmitted
values of checkbits with the computed values. Using
modulo addition (XOR), if the result is 0, the frame is
VALID, otherwise the value it indicates is the ERROR BIT
Hamming Code Method B (HCB)
• Example : ‘ r ’
r -> 114 (ASCII equivalent)
1110010 (binary equivalent)
Position : 1 2 3 4 5 6 7 8 9 10 11
1 1 1 0 0 1 0
Non-checkbit bits power of 2 summation rep’n
3= 2+1
5= 4+1
6= 4+2
7= 4+2+1
9= 8+1
10 = 8+2
11 = 8+2+1
Hamming Code Method B

• Computation of CHECKBITS
CHECKBIT
3 5 7 9 11 (EVEN PARITY)

1 1 1 0 0 0 0
3 6 7 10 11

2 1 1 0 1 0 1
5 6 7

4 1 1 0 0
9 10 11

8 0 1 0 1
Hamming Code Method B
TRANSMITTED FRAME
Position : 1 2 3 4 5 6 7 8 9 10 11
0 1 1 0 1 1 0 1 0 1 0

VALIDATION : compare values of checkbits . . .


checkbit transmitted value computed value RESULT
1 0 0 0
2 1 1 0
4 0 0 0
8 1 1 0

CONCLUSION : FRAME IS VALID


Exercise : Cyclic Redundancy Check

A. Given :
Generator polynomial : x4 + x2 + x
Frame : 1011011000011
Compute for the value of the TRANSMITTED
FRAME (10110110000110100)
B. Given :
transmitted frame : 10011011000001
generator polynomial : x3 + x + 1
Validate the transmitted frame (valid/invalid)
4. Flow control
- throttles the sender into sending no faster than
the receiver can handle traffic
- uses a feedback mechanism, so the sender can
be made aware of whether or not the receiver is able to
keep up

SLIDING WINDOWS PROTOCOLS


sending window - frames that the sender is permitted
to send which corresponds to a set of sequence
numbers
receiving window - frames that the receiver is
permitted to accept
Piggybacking

• technique of temporarily delaying


outgoing acknowledgements so that they
can be hooked onto the next outgoing
data frame
• acknowledgements get a “free ride”
• not 100% effective
Sliding Window Protocols
Three Kinds of Sliding Window Protocols
- categorized according to the size of the window
1. One Bit Sliding Window Protocol
- stop-and-wait protocol
2. Protocol Using Go Back n
- prevents the sender from blocking on a circuit with a long
propagation delay by discarding all frames other than the next one
in sequence
3. Protocol Using Selective Repeat
- prevents the sender from blocking on a circuit with a long
propagation delay by buffering out of order frames until they are
needed
Protocol Specification and Verification
- help demonstrate protocol correctness
1. Finite State Machine Models
- with this technique, each protocol machine is
always in a specific state at every instant of time
- can be regarded as a quadruple SMIT where :
S - is the set of states the processes and channel
can be in
M - is the set of frames that can be exchanged
over the channel
I - is the set of initial states of the processes
T - is the set of transitions between states
deadlock - is a situation which the protocol can make
no forward progress no matter what sequence of
events happen
2. Petri Net Models
- has four basic elements : places, transitions,
arcs and tokens
a. Place - represents a state which the system may be
in
b. token - an indicator used to mark the state of the
system
c. Transition - has zero or more input arcs, coming
from input places, and zero or more output arcs, going
to its output places
d. Arc - may either be incoming or outgoing
Petri Net can be represented in convenient
algebraic form resembling a grammar. Each transition
contributes to one rule of the grammar
Example Data Link Protocols
1.HDLC (High-level Data Link Control)
- derives from the data link protocol used in
IBM’s SNA called SDLC (Synchronous Data Link
Control) protocol
- it later became ADCCP(Advanced Data
Communication Control Protocol) and HDLC
- modified by CCITT and became LAP(Link
Access Procedure) & finally LAPB which was a part of
the X.25 network interface standard
- this can be considered as an old protocol but is
still heavily used in networks throughout the world
2. The Data Link Layer in the Internet
Point to Point Communication
- primarily used in 2 situations where a data link
protocol is required on the line for framing, error
control and other data link functions
a. organizations
- LAN backbone, workstations, servers,
routers, leased lines
b. private individuals
- modems, dial-up telephone lines, internet
provider
A. SLIP (Serial Line IP)
- derived by Rick Adams in 1984
SLIP (Serial Line IP) continued . . .
- workstation just sends raw IP packets over the
line, with special flag byte at the end for framing
- recent versions of SLIP are capable to do some
TCP and IP header compression
Pitfall / Disadvantages of SLIP
1. does not do error detection or correction and
just leaves the job to the higher layers
2. Supports only IP
3. Each side must know the other’s IP address
4. Does not provide any form of authentication
because of the use of dynamic IP addresses
5. Is not approved International Standard
B. PPP (Point-to-Point Protocol)
- was developed because of the problems in SLIP
- handles error correction, supports multiple
protocols, allows IP address to be negotiated at anytime,
permits authentication and has more features than SLIP
3 things provided by PPP
1. A framing method that unambiguously delineates the
end of one frame and the start of the next one. The
frame format also handles error detection
2. A link control for bringing up lines, testing them,
negotiating options, and bringing them down when they
are no longer needed, this protocol is called LCP (Link
Control Protocol)
3. A way to negotiate network-layer options in a way
that is independent of the network layer protocol used,
and have a different NCP (network Control
Protocol)
Protocol for each network layer supported
Medium Access Sublayer
DLL component that caters to
BROADCAST Networks
MEDIUM ACCESS SUBLAYER

• deals with broadcast networks and their


protocols
• broadcast network
• key issue is how to determine who gets to
use the channel when there is competition
for it
• Channel Allocation Problem
– Solution : STATIC vs. DYNAMIC
MULTIPLE ACCESS PROTOCOLS
1. ALOHA
A. Pure ALOHA
- basic idea is simple : let users transmit
whenever they have data to be sent
- prone to collisions and retransmission of
destroyed frames
- see figure 4-1 & 4-2
B. Slotted ALOHA
- divide time into distinct intervals
- always wait for the beginning of a slot before a
frame can be transmitted
- comparison is shown in figure 4-3
MULTIPLE ACCESS PROTOCOLS
2. Carrier Sense Multiple Access Protocol
Carrier Sense Protocols - protocols in which stations listen
for a carrier (i.e., a transmission) and act accordingly
a. Persistent & Nonpersistent CSMA
- general concept of these set of CSMAs is that when a
station has to send data, it first listens to the channel to
see if anyone else is transmitting at the moment, if the
channel is busy, the station waits until it becomes idle
b. CSMA with Collision Detection
- added improvement where stations abort their
transmissions as soon as they detect a collision
- quickly terminating damaged frames saves time and
bandwidth (see figure 4-5)
MULTIPLE ACCESS PROTOCOLS
3. Collision-Free Protocols
a. Bit-Map Protocol
- N slots allotted for N stations where each station has
it’s own slot to determine if they have a frame to
transmit
- the N contention slots would now determine the order
of transmission
- reservation protocol example
- see figure 4-6
b. Binary Countdown
- involves a “bidding” of stations who wants to transmit
based on the station’s address (figure 4-7)
- in fairness to all stations, a round-robin approach on
station priority is observed
MULTIPLE ACCESS PROTOCOLS
4. Limited Contention Protocols
- combines the efficiency of contention protocols during
low loads and efficiency of collision free protocols during
high loads
5. Wavelength Division Multiple Access Protocol
- allows multiple transmissions at the same time where
the spectrum is divided up into channels
- consider figure 4-10
6. Wireless LAN Protocols
- problem depicted on figure 4-11
• hidden station problem
• exposed station problem
MULTIPLE ACCESS PROTOCOLS
a. MACA (Multiple Access with Collision Avoidance)
- basic idea behind is for the sender to stimulate the
receiver into outputting a short frame, so stations nearby
can detect this transmission and avoid transmitting
themselves for the duration of the upcoming data frame
b. MACAW
- fine tuned version of the MACA protocol to improve
performance
7. Digital Cellular Radio
- oriented towards telephony which requires connection
lasting for minutes rather than milliseconds
Digital Cellular Radio
A. GSM (Global System for Mobile Communications)
- digital system & basically circuit switched
- fairly complex system that handles channel access
using a combination of slotted ALOHA, FDM & TDM
B. CDPD (Cellular Digital Packet Data)
- packet switched datagram service
C. CDMA (Code Division Multiple Access)
- allows each station to transmit over the entire
frequency spectrum all the time using a coding theory
IEEE Standard 802 for LANS and MANS

1. IEEE Standard 802.3 and Ethernet


Advantages:
a. Most widely used
b. protocol is simple
- stations can be installed on the fly
c. passive cable is used and modems are not required
d. delay at low load is zero
Disadvantages :
a. Has a substantial analog component
b. Nondeterministic - not possible for real-time work
IEEE Standard 802 for LANS and MANS

c. No priorities
d. round-trip cable length determines the slot time
hence the performance and it is limited to 2.5 km
e. at high load, the presence of collisions becomes a
major problem and can seriously affect the throughput
2. IEEE Standard 802.4 and Token Bus
Advantages :
a. uses highly reliable television equipment which is
readily available
b. More deterministic than 802.3
c. It can handle short minimum frames
d. supports priorities
e. At high load, it has excellent throughput & efficiency
IEEE Standard 802 for LANS and MANS

f. Can support multiple channels, not only for data but for
voice & television
Disadvantages
a. Uses a lot of analog engineering & includes modems
and wideband amplifiers
b. Protocol is extremely complex and has a substantial
delay at low load
c. Not widely used
d. Poorly suited for fiber optic implementations
3. IEEE Standard 802.5 and Token Ring
Advantages
a. uses point-to-point connection
- engineering is easy and fully digital
b. rings can be built using any transmission medium
IEEE Standard 802 for LANS and MANS

c. the standard twisted pair is cheap and easy to install


d. the use of wire centers make the token ring the only
LAN that can detect and eliminate cable failures
automatically
e. At high load, throughput & efficiency are excellent
f. priorities are possible but not as fair
g. Handles short frames
Disadvantages
a. Cannot handle arbitrary large frames
b. At low load, there is a tremendous delay
c. Even with the presence of a monitoring station which
introduces a critical component, we are not assured that
the solution it takes would be the best one
IEEE Standard 802 for LANS and MANS

4. IEEE Standard 802.6 and DQDB


- unlike the first 3, this can handle MANs
- during transmission, it is not greedy but instead lines
up in a queue and follows a FIFO order
- polite in the sense that it doesn’t grab free cells when
it sees it & still respects the order
- typically they can run for up to 160 km and speeds of
44.736 Mbps (T3)
5. IEEE Standard 802.2 and Logical Link Control
- can run on top of all the 802 LAN & MAN protocols
- hides the differences between the various kinds of 802
networks by providing a single format and interface to
the network layer
IEEE Standard 802 for LANS and MANS

6. IEEE Standard 802.11


- wireless LANs standards
 802.11a
 802.11b
 802.11c
Bridges
Six Reasons why an Organization may end up with multiple
LANs
1. Many departments exists in an organization, each having
their own requirements and their own LAN to fulfill it
2. The organization may be geographically spread over
several buildings separated by considerable distances
3. It may be necessary to split what is logically a single LAN
into separate LANs to accommodate the load
4. Physical distance is too great between some
machines/stations in the LAN
5. Reliability
6. Security
Types of Bridges
1. Transparent Bridge
2. Source Routing Bridge
High Speed LANS

• FDDI (Fiber Distributed Data Interface)


– is a high performance fiber optic token ring LAN
running at 100 Mbps over distances up to 200 km
– up to 1000 stations connected
– used as a backbone to connect copper LANs (figure
4-44)
– detects & remedies cable failures(see figure 4-45)
– closely modeled after the 802.5 protocols
• Fast / Gigabit Ethernet
– was called 802.3u ( not a new standard but a
addendum to the current one)
– backward compatible
– Very popular
High Speed LANS
• HIPPI (High Performance Parallel Interface)
– was originally designed to be data channel rather than
LAN
– consists of 50 to 100 twisted pairs
– basic protocol is that, to communicate, a host first ask
the crossbar switch to set up a connection, then it sends
a single message and releases the connection
– supercomputer interconnect standard for years
– see figure 4-48
• Fibre Channel
– successor of HIPPI
– instead of using twisted pairs, it uses fiber optics
– more expensive
– still uses a crossbar switch to connect inputs to outputs
Character Count

Back to PAGE
Character Stuffing

Back to PAGE
Bit Stuffing

Back to PAGE
Cyclic Redundancy Check

Back to PAGE
Hamming Codes

Back to PAGE
Aloha Protocols

back
Comparison : Slotted vs. Pure

back
Comparison

back
Bit-map protocol

back
Binary Countdown Protocol

back
WDMA Protocol

back
WLAN Protocol

back
FDDI

back
FDDI

back
HIPPI

back
MIDTERM EXAMS
• From TELEPHONE SYSTEM until MAC Sublayer
• ICT Research Congress Topics are included
• Purely objectives
• EXAM is Online
• THURSDAY (5:30 – 6:30 PM @ S326)
• First meeting next week
• MIDTERM ASSIGNMENT : Discuss the different
types of IEEE 802.11 standards (due date :
Wedenesday; before the EXAM)

You might also like