Sie sind auf Seite 1von 153

Computer Network (CN)

Unit 4: Medium Access Control Sublayer

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

MAC Layer Overall


Deal with broadcast networks and their protocols.
The key issue is to determine WHO gets to use the channel
when there is competition.
Broadcast channels are sometimes referred to as multi
access channels or random access channels.
The protocols used to determine who gets next on a multi
access channel belong to a sub layer of the data link layer
called the MAC (Medium Access Control) sub layer.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

Topics
Channel Allocation Problem
Random Access Protocols
Controlled Access
Channelization
Ethernet
Data Link Layer Switching
HDLC
PPP
Introduction to X.25, Frame Relay and ATM
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

4.1 The Channel Allocation Problem


4.1.1 Static Channel Allocation in LANs and MANs
FDM: Frequency Division Multiplexing
TDM: Time Division Multiplexing
Advantage?
Disadvantage?
Advantage : Suitable for fixed number of users with constant traffic

Disadvantage: When the number of users is large and


continuously
varying or the traffic is bursty, FDM presents
some problems.

Rejo Mathew, Asst Prof,


IT

4.1 The Channel Allocation Problem


4.1.1 Static Channel Allocation in LANs and MANs
A simple queuing theory calculation
Channel capacity = C bps, Arrival rate = frames/sec,
each frame having a length drawn from an exponential
probability density function with mean 1/ bits/frame,

1
Mean Time delayT
C

divide the single channel up into N independent subchannels,


each with capacity C/N bps.
The mean input rate on each of the subchannel will now be
/N. Recomputing T, we get

TFDM

NT
(C / N ) ( / N )
Rejo Mathew, Asst Prof,
IT

4.1 The Channel Allocation Problem


4.1.2 Dynamic Channel Allocation in LANs and MANs
Five key assumptions:
1. Station Model. The model consists of N independent stations,
each with a program or user that generates frames for
transmission.
The probability of a frame being generated in an interval of
length t is t, where is a constant (the arrival rate of new
frames).
Once a frame has been generated, the station is blocked and
does nothing until the frame has been successfully
transmitted.
2. Single Channel Assumption. A single channel is available for
all communication. All stations can transmit on it and all can
receive from it.
Rejo Mathew, Asst Prof,
IT

As far as the hardware is concerned, all stations are equivalent,

4.1 The Channel Allocation Problem


4.1.2 Dynamic Channel Allocation in LANs and MANs
Five key assumptions:
3. Collision Assumption. If two frames are transmitted
simultaneously, they overlap in time and the resulting signal is
garbled. This event is called a collision.
All stations can detect collisions. A collided frame must be
transmitted again alternately. There are no errors other than
those generated by collisions.

Rejo Mathew, Asst Prof,


IT

4.1 The Channel Allocation Problem


4.1.2 Dynamic Channel Allocation in LANs and MANs
Five key assumptions:
4a. Continuous Time. Frame transmission can begin at any
instant. There is no master clock dividing time into discrete
intervals.
4b. Slotted Time. Time is divided into discrete intervals (slots).
Frame transmissions always begin at the start of a slot. A slot
may contain 0, 1, or more frames, corresponding to an idle
slot, a successful transmission, or a collision, respectively.
5a. Carrier Sense. Stations can tell if the channel is in use
before trying to use it. If the channel is sensed as busy, no
station will attempt to use it until it goes idle.
5b. No Carrier Sense. Stations cannot sense the channel before
trying to use it. They just go ahead and transmit. Only later can
Rejo Mathew, Asst Prof,
they determine whether or not the transmission was
IT
successful.

4.2 Multiple Access Protocols


4.2.1 ALOHA
Pure ALOHA
the first multipleaccess protocol: a
method for sharing
a
transmission
channel by
enabling the
transmitter to
access the
channel at random
times

ALOHA of U. of Hawaii

Computer
Center

413MHz at 9600bps
407MHz at 9600bps
Rejo Mathew, Asst Prof,
IT

4.2 Multiple Access Protocols


4.2.1 ALOHA
Pure ALOHA

Frames are transmitted at completely


arbitrary times.

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.1 ALOHA
Pure ALOHA protocol

nodes transmit on a common channel


transmit frame of fixed length
when two transmissions overlap, they garble each other
(collision)
the central node acknowledges the correct frames it receives
when a node does not get an acknowledgment within a specific
timeout, it assumes that its frame collided
when a frame collides, the transmitting node schedules a
retransmission after a random delay

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.1 ALOHA
nodes
new frame

S
G

channel

collision?
No

old frame
Yes

S: the mean number of new frames generated by the infinite population


G: the mean number of transmission attempts
(new and old combined)
where P0 is the probability that a frame does not suffer a
0 collision

S GP

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.1 ALOHA
pure ALOHA and slotted ALOHA
pure ALOHA
time
Nodes can starting transmitting at any time.
slotted ALOHA
slot
time

Nodes must start their transmissions at the beginning of a time slot.


Rejo Mathew, Asst Prof,
IT

4.2 Multiple Access Protocols


4.2.1 ALOHA
vulnerability period
pure ALOHA
packet

slotted ALOHA
packet

Other nodes that are ready at this period will result in collision.
Rejo Mathew, Asst Prof,
IT

4.2 Multiple Access Protocols


4.2.1 ALOHA

The probability that k frames are generated during a given frame


time is given by the Poisson distribution:

G k eG
Pr[k ]
k!

So the probability of zero frames in a slot is


just e-G.

In an interval two time slots long, the mean number of frames


generated is 2G. Therefore, the distribution is:

( 2G ) k e 2G
Pr[k ]
k!

The probability of zero frames is e-2G.

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.1 ALOHA
Using S=GP0, we get
For pure ALOHA: S=Ge-2G
For slotted ALOHA: S=Ge-G
To find the maximum value:

dS
dS
e G Ge G ,
0 G 1, S e 1
dG
dG
1
dS
dS
1
e
S Ge 2G ,
e 2G 2Ge 2G ,
0 G ,S
dG
dG
2
2
S Ge G ,

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.1 ALOHA

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.1 ALOHA
In slotted ALOHA, the best we can hope for is 37% success, 37%
slots empty, and 26% collisions. Operating at higher values of G
reduces the number of empties but increases the number of
collisions exponentially.
Consider the transmission of a test frame:
success: e-G, failure: 1-e-G, success for k attempts:
Expected number of transmissions:

k 1

k 1

Pk e G (1 e G ) k 1

E kPk ke G (1 e G )k 1 eG
As a result of the exponential dependence of E upon G, small increases
in the channel load can drastically reduce its performance.
Rejo Mathew, Asst Prof,
IT

4.2 Multiple Access Protocols


4.2.2 Carrier Sense Multiple Access Protocols
With slotted ALOHA the best channel utilization that can be
achieved is 1/e. As stations transmitting at will, without paying
attention to what other stations are doing, there are bound to be
many collisions.
In local area networks, however, it is possible for stations to detect
what other stations are doing, and adapt their behavior accordingly.
Protocols in which stations listen for a carrier (i.e. a transmission)
and act accordingly are called carrier sense protocols.

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.2 Carrier Sense Multiple Access Protocols

persistent CSMA: if channel idle


-> Transmits with a probability of 1
if channel is busy -> Waits until it becomes idle

persistent CSMA: if the channel is idle -> Transmits,


If channel is busy
-> Waits a random time and tries a
p-persistent CSMA (slotted): if channel idle -> Transmits with a
probability p
if channel is busy -> Waits until the
next slot 1-p.
If another station transmitting-> Waits a random time and tries
again.
(p=0.5, p=0.75 )takes any value

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.2 Carrier Sense Multiple Access Protocols

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.2 Carrier Sense Multiple Access Protocols
CSMA with collision detection (CSMA/CD)
Abort a transmission as soon as they detect a collision. Quickly
terminating damaged frames saves time and bandwidth.
After a station detects a collision, it aborts its transmission, waits a
random period of time, and then tries again, assuming that no
other station has started transmitting in the meantime.

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.2 Carrier Sense Multiple Access Protocols
A conceptual model for CSMA/CD
(How long should each slot be?)

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.2 Carrier Sense Multiple Access Protocols
maximum collision detection time
A
1.A starts
transmitting

3. A reaches B
5.B reaches A

B
t=0

2.B starts
transmitting

PROP
4.B detects collision,
transmits JAM, stops

2PROP

6.A detects collision,


transmits JAM, stops
The maximum collision detection time is equal to
twice the maximum end-to-end propagation delay.
Rejo Mathew, Asst Prof,
IT

4.2 Multiple Access Protocols


4.2.2 Carrier Sense Multiple Access Protocols
For this reason we will model the contention interval as a slotted
ALOHA system with slot width 2 ( is the end to end delay). On a
1-km long coaxial cable, 5sec.

It is important to realize that collision detection is an analog


process. The stations hardware must listen to the cable while it
is transmitting. The signal encoding must allow collisions to be
detected (e.g., a collision of two 0-volt signals may well be
impossible to detect). For this reason, special encoding is
commonly used.

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.3 Collision-Free Protocols
Although collisions do not occur with CSMA/CD once a station has
unambiguously seized the channel, they can still occur during
the contention period. These collisions adversely affect the
system performance, especially when the cable is long and the
frames are short. As very long, high bandwidth fiber optic networks
come into use, the combination of large and short frames will
become an increasingly serious problem.

In the protocols to be described, we make the assumption that there


are N stations, each with a unique address from 0 to N-1 wired into
it.

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.3 Collision-Free Protocols
A bit-map protocol

Protocols like this in which the desire to transmit is broadcast before


the actual transmission are called reservation protocols.

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.3 Collision-Free Protocols
Performance of bit-map protocol
Assuming contention slot: 1 slot, data slot: d slots
Low-numbered stations must wait on the average 1.5N slots and
high-numbered stations must wait on the average 0.5N slots
before starting to transmit, the mean for all stations is N slots.

Channel efficiency at low load: d/(N+d)


Channel efficiency at high load: Nd/(N+Nd)=d/(d+1)

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.3 Collision-Free Protocols
Binary Countdown

Stations binary
address

A dash
indicates
silence.

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.3 Collision-Free Protocols
Binary Countdown
The channel efficiency of this method is d/(d+lnN). If, however,
the frame format has been cleverly chosen so that the senders
address is the first field in the frame, even these lnN bits are not
wasted, and the efficiency is 100%.

Variations: Use virtual station numbers. The successful station


being circularly permuted after each transmission.
Stations C H D A G B E F
Priority 7 6 5 4 3 2 1 0
Priority 7 6 0 5 4 3 2 1

if D transmits
others are promoted
Rejo Mathew, Asst Prof,
IT

4.2 Multiple Access Protocols


4.2.4 Limited-Contention Protocols
Two important performance measures for channel acquisition
strategies: delay at low load and channel efficiency at high load

delay
Light load

Contention protocol
Contention-free protocol

channel
efficiency
Heavy load

good

bad

bad

good

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.4 Limited-Contention Protocols
Obviously, it would be nice if we could combine the best
properties of the contention and collision-free protocols, arriving
at a new protocol that used contention at low loads to provide low
delay, but used a collision-free technique at high load to provide
good channel efficiency.

Such protocols will be called limited contention protocols.

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.4 Limited-Contention Protocols
Up until now the only contention protocols we have studied have
been symmetric, that is, each station attempts to acquire the
channel with some probability p, will all stations using the same
p.
Performance of the symmetric case: suppose that k stations are
contending for channel access, each has a probability p of
transmitting during each slot
The probability that some station successfully acquire the channel is
kp(1-p)k-1
k 1

k 1
Maximum occurs at p=1/k with Pr[success with optimal p]=
k
Rejo Mathew, Asst Prof,
IT

4.2 Multiple Access Protocols


4.2.4 Limited-Contention Protocols
As soon as the number of stations reaches even 5,
the probability has dropped close to it asymptotic
value of 1/e.

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.4 Limited-Contention Protocols
Limited contention protocols decrease the amount of
competition by dividing the stations up into (not
necessarily disjoint) groups. Only the members of group 0
are permitted to compete for slot 0. If one of then succeeds, it
acquires the channel and transmits its frame.
If the slot lies fallow or if there is a collision, the members of
group 1 contend for slot 1, etc. by making an appropriate
division of stations into groups, the amount of contention for
each slot can be reduced, thus operating each slot near the left
end of Fig. 4-8.

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.4 Limited-Contention Protocols
The adaptive tree walk protocol
Slot 0
Depth first search
for all ready
stations
Slot 1 (if collision)

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.4 Limited-Contention Protocols
When the load on the system is heavy, it is hardly worth the effort
to dedicate slot 0 to node 1, because that makes sense only in the
unlikely event that precisely one station has a frame to send.
Similarly, one could argue that nodes 2 and 3 should be skipped as
well for the same reason.

Put in more general terms, at what level in the tree should the
search begin?

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.4 Limited-Contention Protocols
Assume that each station has a good estimate of the number of ready
stations, q, for example, from monitoring recent traffic.
Assume the root (node 1) is at level 0. Each node at level i has a
fraction 2-i of the stations below it.
If the q ready stations are uniformly distributed, the expected
number of them below a specific node at level i is just 2-iq.
Intuitively, we would expect the optimal level to begin searching
the tree as the one at which the mean number of contending
stations per slot is 1, that is, the level at which
2-iq=1. Solving this equation we find that i=log2q.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.4 Limited-Contention Protocols
Improvements:
For example, consider the case of stations G and H being the
only ones waiting to transmit.
Probe node 1: collision
Probe node 2: idle
Probe node 6: idle
Probe G
Probe H
Node 3 and node 7 can be
skipped. Why?

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.6 Wireless LAN Protocols
The hidden terminal problem

When A transmits to B and C also transmits to B simultaneously,


the frames will be collided at B. Since A and C can not see each
other.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.6 Wireless LAN Protocols
The exposed terminal problem

When C hears Bs transmission intended for A, it may


falsely conclude that it can not send to D now.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.6 Wireless LAN Protocols
MACA (Multiple Access with Collision Avoidance)

MACA: basis for IEEE802.11 wireless LAN standard


The basic idea behind it is for the sender to simulate the
receiver into outputting a short frame, so stations nearby can
detect this transmission and avoid transmitting themselves fir
the during of upcoming (large) data frame.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.6 Wireless LAN Protocols
MACA (Multiple Access with Collision Avoidance)

RTS (30 bytes) and CTS contains the data length that will eventually follow.
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.6 Wireless LAN Protocols
MACA (Multiple Access with Collision Avoidance)

Any station hearing the RTS is clearly close to A and must remain
silent long enough for the CTS to be transmitted back to A without
conflict.
Any station hearing the CTS is clearly close to B and must remain
silent during the upcoming data transmission, whose length it can
tell by examining the CTS frame.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.6 Wireless LAN Protocols
MACA (Multiple Access with Collision Avoidance)

Despite these precautions, collisions can still occur. For example, B


and C could both send RTS frames to A at the same time. In the
event of a collision, an unsuccessful transmitter (I.e., one that does
not hear a CTS within the expected time interval) waits a random
amount of time and tries again later. The algorithm used is binary
exponential backoff.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.2 Multiple Access Protocols


4.2.6 Wireless LAN Protocols
MACAW (MACA for Wireless)
1.
2.
3.
4.

Introducing an ACK frame after each successful data


transmission
Adding carrier sense (keeping a station from transmitting an
RTS at the same time another nearby station is also doing so
to the same destination
Running the backoff algorithm separately for each data stream
rather than for each station (improving fairness)
Exchanging information about congestion between stations
and making backoff algorithm react less violently

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

Controlled Access
Reservation
Polling
Token passing

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

Channelization
FDMA
TDMA
CDMA

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
IEEE 802.1 Bridging (networking) and Network
Management
IEEE 802.17 Resilient packet ring
IEEE 802.2 Logical link control
IEEE 802.18 Radio Regulatory TAG
IEEE 802.3 Ethernet
IEEE 802.19 Coexistence TAG
IEEE 802.4 Token bus
IEEE 802.20 Mobile Broadband
IEEE 802.5 Defines the MAC layer for a Token Ring
Wireless Access
IEEE 802.6 Metropolitan Area Networks
IEEE 802.21 Media Independent
IEEE 802.7 Broadband LAN using Coaxial Cable
Handoff
IEEE 802.8 Fiber Optic TAG
IEEE 802.22 Wireless Regional Area
IEEE 802.9 Integrated Services LAN
Network
IEEE 802.10 Interoperable LAN Security
IEEE 802.11 Wireless LAN & Mesh (Wi-Fi
certification)
IEEE 802.12 demand priority
IEEE 802.13 Cat.6 - 10Gb lan (new founded)
IEEE 802.14 Cable modems
IEEE 802.15 Wireless PAN
IEEE 802.15.1 (Bluetooth certification)
IEEE 802.15.4 (ZigBee certification)
IEEE 802.16 Broadband
Wireless
AccessManagement and
Rejo Mathew, Asst Prof,
Mukesh Patel
School of Technology
IT
(WiMAX certification) Engineering www.nmims.edu/Engineering

4.3 Ethernet

IEEE 802.3: 1-persistent CSMA/CD

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet

To allow larger networks, multiple cables can be connected by


repeaters.
A repeater is a physical layer
device.
It receives, reenergizes and
reshapes the signals in both
directions. As far as the software is
concerned, a series of cable
segments connected by repeaters
is no different than a single cable.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet

Cable topologies. (a) Linear, (b) Spine, (c) Tree, (d) Segmented

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

10BASE5
10BASE2
1BASE5
10BROAD36
10BA
Ethernet
Cheaper net
StarLAN
Broadband
Twisted
coaxial cabletwisted-paircoaxial cable 2 simplex TP
medium coaxial cable
50ohm-10mm
50ohms-5mm
unshielded 75ohms
unshielded
10Mbps
Manch
maximum
segment 500m
maximum
2.5km
distance
signals

nodes per
segment

100

10Mbps
Manch

1Mbps
Manch

10Mbps
DPSK

10Mbps
Manch

185m

500m

1800m

100m

0.925km

2.5km

3.6km

1km

30

activity on
2 active hub transmission
excess current
receiver and
inputs
=reception
transmitter
Notes slot time=512 bits; gap time=96 bits; jam=32 to 48 bits

collision
detection

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet

Manchester Encoding

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet

802.3 frame format

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet

802.3 frame format


Minimum frame length: 64 bytes

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet

802.3 Frame Format


As the network speed goes up, the minimum frame length must go up or
the maximum cable length must come down proportionally.
Distance = 2500m Speed = 1 Gbps, Min.frame size = 6400 bytes.
Alternatively,
Min.frame size = 64 bytes Max distance = 250 meters.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet

Ethernet Frame Structure v2 (or DIX Ethernet, for DEC, Intel, Xerox)
7

eamble

SFD

DA

6
SA

type

Data

CRC

60 to 1514 bytes

synchronize
the receiver

Cyclic Redundancy Check


Type>0x0600=1536

Start Frame
Delimiter

0800: IPv4 datagram


0806: ARP request/reply
8035: RARP request/reply
86DD: IPv6

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

Improving Aloha
Aloha
Low goodput

What is missing in Aloha?


Carrier sensing not done; a node transmits
whenever it wants to

How can it be improved?


Sense the carrier before transmission

Will this improve Aloha?


Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Carrier Sense Multiple Access


(CSMA)
When medium sensed two possibilities
Medium busy or free
a) If medium free transmit immediately
b) If medium busy wait (how long?)
i.

Goto (a)

This is non-persistent CSMA; what are the


variables?

Improving CSMA: the variables here are


) wait time when to sense again
) instant when to transmit
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Carrier Sense Multiple Access


(CSMA)
Wait time and transmit instant each can be
Random or 0, (changing according to some algorithm)

Wait time
0 = persistent
Random = non-persistent

Transmit instant
Transmit with probability p
Node can transmit now, since medium is free
It tosses a coin and then decides (p=0.5)
If wait time=0; and p=1 then called p-persistent CSMA
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Changing Transmit Time


More nodes
Two node is trivial; add more nodes
A] Wait for some time; then check the medium
again
Since some node may have started already
What is the flaw with this approach? We have
separated the nodes

Fairness: Some nodes may be stuck in [A]


forever
Some algorithm needed to tackle this problem
How to achieve fairness?
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Medium Access Control Logic

IEEE 802.11 Exponential Backoff


Node selects a random wait time t; from a
contention window time interval
To ensure fairness
Nodes which have waited longer should have preference
Need to determine nodes which have waited longer

Backoff algo should handle this


Sense medium during backoff interval; if medium busy
then freeze backoff timer
When medium free again, unfreeze backoff timer

Is this good enough?


Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

IEEE 802.11 Exponential Backoff


Two nodes -> some more nodes -> Add large number of
nodes
Is the backoff algo good enough?

Primarily we are trying to do TDMA


Since large number of nodes; need to be spaced out
further in time
With base station infrastructure, the BS does it
Here the nodes have to do it themselves
Effectively make the frame bigger and transmit in a later slot

802.11 Binary Exponential backoff


If collision after backoff timer; double the backoff time window
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

4.3 Ethernet

The Binary Exponential Backoff Algorithm


If a frame has collided n successive times, where n<16, then the
node chooses a random number K with equal probability from the
set {0,1,2,3,...,2m-1} where m=min{10,n}. The node then waits
for
bit times. (slot time=512 bit time)

K 512

after first collision


after second collision
after third
collision
select one to start transmission
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet

Acknowledgements
As far as CSMA/CD is concerned, an acknowledgement would be
just another frame and would have to fight for channel time just
like a data frame.
(What is the problem?)
A simple modification would allow speedy confirmation of frame
receipt. All that would be needed is to reserve the first
contention slot following successful transmission for the
destination station.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet

Performance
Assume k stations are always ready to transmit and a constant
retransmission probability in each slot. (A rigorous analysis of the
binary exponential backoff algorithm is complicated.)
If each station transmits during a contention slot with probability p,
the probability A that some station acquires the channel in that slot
is

A kp (1 p ) k 1

1
A is maximized when p , with
k
A 1/e as k .
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet

Performance
The probability that the contention interval has exactly j slots in it
is A(1-A)j-1, so the mean number of slots per contention is given by

jA(1 A)
j 0

j 1

Since each slot has a duration 2, the mean contention interval, w, is


2/A. Assuming optimal p, the mean number of contention slots is
never more than e, so w is at most 2e5.4.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet

Performance
If the mean frame takes P sec to transmit, when many stations
have frames to send,
channel efficiency=

P
P 2 / A

Here we see where the maximum cable distance between any two
stations enters into the performance figures. The longer the cable,
the longer the contention interval. By allowing no more than
2.5km of cable and four repeaters between any two transceivers,
the round-trip time can be bounded to 51.2 sec, which at 10Mbps
corresponds to 512 bits or 64 bytes, the minimum frame size.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet

Performance
Let P=F/B (frame_length/bandwidth) and =L/C
(cable_length/signal_propagation_speed). For the optimal case of
e contention slots per frame,
channel efficiency=

1
1 2 BLe / cF

Increasing network bandwidth or distance (the BL product)


reduces efficiency for a given frame size. Unfortunately, much
research on network hardware is aimed precisely at increasing this
product. People want high bandwidth over long distances, which
suggests that 802.3 may not be the best system for these
applications.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet

Many theoretical analysis assume the input traffic is Poisson. It


now appears that network traffic is rarely Poisson, but selfsimilar. What this means is that averaging over long periods of
time does not smooth out the traffic.
The average number of packets in each minute of an hour has as
much variance as the average number of packets in each second
of s minute.
The consequence of this discovery is that most models of
network traffic do not apply to the real world and should be
taken with a grain of salt.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet

Switched 802.3 LANs

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
Fast Ethernet
The three primary reasons that the 803 committee decided to
go with a souped-up 802.3 LAN (instead of a totally new
one) were:
1. The need to be backward compatible with thousands of
existing LANs.
2. The fear that a new protocol might have unforeseen
problems.
3. The desire to get the job done before the technology
changed.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
Fast Ethernet
The basic idea behind fast Ethernet was simple: keep all the old
packet formats, interfaces, and procedural rules, but just reduce the
bit time form 100 nsec to 10 nsec.
Technically, it would have been possible to copy 10Base5 or
10Base2 and still detect collisions on time by just reducing the
maximum cable length by a factor of ten.
However, the advantages of 10BaseT wiring were so overwhelming
that fast Ethernet is based entirely on this design. Thus all fast
Ethernet systems use hubs.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
Fast Ethernet

The category 3 UTP scheme, called 100Base-T4, uses a signaling


speed of 25 MHz, only 25 percent faster than standard 802.3s 20
MHz. To achieve the necessary bandwidth, 100BaseT4 requires four
twisted pairs.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
Fast Ethernet
Of the four twisted pairs, one is always to the hub, one is always from
the hub, and the other two are switchable to the current transmission
direction.
To get the necessary bandwidth, Manchester encoding is not used,
but with modern clocks and such short distances, it is no longer
needed.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
Fast Ethernet
Ternary signals are sent, so that during a single clock period the wire
can contain a 0, a 1, or a 2. With three twisted pairs going in the
forward direction and ternary signaling, any one of the 27 possible
symbols can be transmitted, making it possible to send 4 bits with
some redundancy. Transmitting 4 bits in each of the 25 million clock
cycles per second gives the necessary 100 Mbps.

In addition, there is always a 33.3 Mbps (100/3) reverse channel


using the remaining twisted pair. This scheme, known as 8B6T, (8
bits map to 6 trits) is not likely to win any prizes for elegance, but it
works with the existing wiring plant.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
Fast Ethernet
For category 5 wiring, the design, 100Base-TX, is simpler because
the wires can handle clock rates up to 125 MHz and beyond. Only
two twisted pairs per station are used, one to the hub and one from
it.
Rather than just use straight binary coding, a scheme called 4B5B is
used at 125 MHz. Every group of 5 clock periods is used to send 4
bits in order to give some redundancy, provide enough transitions to
allow easy clock synchronization, create unique patterns for frame
delimiting, and be compatible with FDDI in the physical layer.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
Fast Ethernet
Consequently, 100Base-TX is a full-duplex system; stations can
transmit at 100 Mbps and receive at 100 Mbps at the same time.
Often 100Base-TX and 100Base-T4 are collectively referred as
100Base-T.

The last option, 100Base-FX, uses two strands of multimode fiber,


one for each direction, so it, too, is full duplex with 100 Mbps in each
direction. In addition, the distance between a station and the hub
can be up to 2 km.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
Fast Ethernet
Two kinds of hubs are possible with 100Base-T4 and 100Base-TX:
hub: all incoming lines are logically connected, forming a single
collision domain.
switches: each incoming frame is buffered on a plug-in line card.
Buffered frames are passed over a high-speed backplane from the
source card to the destination card.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
Gigabit Ethernet
The ink was barely dry on the fast Ethernet standard when the
802 committee bagan working on a yet faster Ethernet. It was
quickly dubbed gigabit Ethernet and was ratified by IEEE in 1998
under the name 802.3z.

An important design goal: remain backward compatibility

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
Gigabit Ethernet
All configurations of gigabit Ethernet are point-to-point.

Each individual Ethernet cable has exactly two devices on it, no more
and no fewer.
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
Gigabit Ethernet
Two different modes of operation: full duplex and half duplex
Normal mode -- full-duplex - connected to a switch.

No need to sense the channel because contention is impossible. So


CSMA/CD protocol is not used.

So the maximum length of the cable is determined by signal


strength issues rather than by the collision detection issue.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
Gigabit Ethernet
Half-duplex -- connected to a hub.
A hub does not buffer incoming frames. So collisions are possible
and CSMA/CD is required.

Transmission time for a 64-byte frame - 100 times faster.


So the distance is 100 times < Ethernet i.e. 25 meters.

The 802.3z committee considered a radius of 25 meters to be


unacceptable and added two features to the standard to
increase the radius.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
Gigabit Ethernet
1.Carrier extension, essentially tells the hardware to add its own
padding to extend the frame to 512 bytes. Of course, using 512
bytes to transmit 64 bytes of data has a line efficiency of 9%.

2.Frame bursting, allows a sender to transmit a concatenated


sequence of multiple frames in a single transmission. If the total
length is less than 512 bytes, the hardware pads it again.

Just for backward compatibility. Most will use switches.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
Gigabit Ethernet
Cabling

Gigabit Ethernet uses new encoding rules on the fiber. Manchester


encoding at 1Gbps would require 2G baud signal, too difficult and
too wasteful.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
Gigabit Ethernet
8B/10B is used. Each 8-bit byte is encoded as 10 bits.
256 out of 1024. Two rules are used:
1. No codeword may have more than four identical bits in a row.
2. No codeword may have more than six 0s or six 1s.
In addition, many input bytes have two possible codewords assigned
to them. When there is a choice, the encoder always chooses the
one that tries to equalize the number of 0s and 1s transmitted so
far.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
Gigabit Ethernet
1000Base-T uses a different encoding scheme since clocking data
onto copper wire in 1 nsec is too difficult.
The solution uses four category 5 twisted pairs to allow four
symbols to be transmitted in parallel.
Each symbol is encoded using one of five voltage levels. This
scheme allows a single symbol to encode 00, 01, 10, 11, or a
special value for control purposes.
The clock runs at 125MHz, allowing 1-Gbps operation.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
Gigabit Ethernet
Gigabit Ethernet supports flow control which consists of one end
sending a special control frame to the other end telling it to pause
for some period of time.
For gigabit Ethernet, the time unit for pause is 512 nsec. The
maximum is 33.6 msec.
802.3ae: 10G Ethernet

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
IEEE Standard 802.2: Logical Link Control

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.3 Ethernet
Why Ethernet is so successful? Last more than 20 years!
Ethernet is simple and flexible.
Simple translates into reliable, cheap, and easy to maintain.
Ethernet interworks easily with TCP/IP. Both IP and Ethernet are
connectionless.
Speed can catch up with other standards.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching

Bridge
A

C
LANs can be connected by devices called bridges, which operate in
the data link layer. Bridges do not examine the network layer header.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching

Router
A

Router
In contrast, a router examines network layer headers.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching

Multiple LANs connected by a backbone to handle a total load


higher than the capacity of a single LAN.
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Why a single organization may end up with multiple LANs? (to need
bridges)
1.
2.
3.
4.
5.
6.

Autonomy of departments to choose their own types of LANs


Cheaper to have separate LANs than to run a single large LANs
Load splitting
Physical distance is too great. (For example, >2.5km in 802.3)
More reliable
More secure

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching

Operation of a LAN bridge from 802.11 to 802.3.


Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Bridges from 802.x to 802.y
You might naively think that a bridge from 802 LAN to another
one would be completely trivial. Such is not the case. Each of the
nine combinations of 802.x to 802.y has its own unique set of
problems.
General problems:
1. Different frame format
2. Different data rate
3. Different maximum frame length

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Bridges from 802.x to 802.y

The IEEE 802 frame formats. The drawing is not to scale.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Transparent Bridges
Plug and play bridge

When a frame arrives, a bridge must decide whether to discard or


forward it, and if the latter, on which LAN to put the frame. The
decision is made by looking up the destination address in a big
(hash) table inside the bridge.
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Transparent Bridges
When the bridges are first plugged in, all the hash tables are
empty. None of the bridges know where any of the destinations
are, so they use the Flooding algorithm.
Use backward learning algorithm. If a frame comes from LAN1
with source address A, the bridge learns that host A is in LAN1.
The topology can change as machines and bridges are powered up
and down and moved around. To handle dynamic topologies,
whenever a hash table entry is updated, the time is recorded.
Periodically, a process in the bridge scans the hash table and
purges
entries more
a few minutes
Routingall
procedure
for athan
transparent
bridge:old.
1. If the destination and source LANs are the same, discard the
frame.
2. If the destination and source LANs are different, forward the
frame.
3. If the destination LAN is unknown, use flooding.
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Transparent Bridges

Avoid looping in parallel bridges.


Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Transparent Bridges
Spanning Tree Bridges

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Transparent Bridges
Spanning Tree Bridges

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Transparent Bridges
Spanning Tree Bridges
To build the spanning tree, first the bridges have to choose one
bridge to be the root of the tree. They make this choice by having
each one broadcast its serial number, installed by the
manufacturer, and guaranteed to be unique worldwide. The bridge
with the lowest serial number becomes the root. Next, a tree of
shortest paths from the root to every bridge and LAN is
constructed.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Source Routing Bridges
Source routing assumes that the sender of each frame knows
whether or not the destination is on its own LAN. When sending a
frame to a different LAN, the source machine sets the high-order
bit of the source address to 1, to mark it. Furthermore, it includes
in the frame header the exact path that the frame will follow.
This path is constructed as follows. Each LAN has a unique 12-bit
number, and each bridge has a 4-bit number that uniquely
identifies it in the context of its LANs. A route is then a sequence of
bridge, LAN, bridge, LAN, numbers.

For example, the route from A to D: (L1, B1, L2, B2, L3)
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Source Routing Bridges
A source routing bridge is only interested in those frames with the
high-order bit of the destination set to 1.
For each such frame, it scans the route looking for the number of
the LAN on which the frame arrived.
If this LAN number is followed by its own bridge number, the
bridge forwards the frame onto the LAN whose number follows its
bridge number in the route.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Source Routing Bridges
Three possible implementations:
1. Software: the bridge runs in promiscuous mode, copying all
frames to its memory to see if they have the high-order destination
bit set to 1. If so, the frame is inspected further.
2. Hybrid: the bridges LAN interface inspects the high-order
destination bit and only accepts frame with the bit set. This
interface is easy to build into hardware and greatly reduces the
number of frames the bridge must inspect.
3. Hardware: the bridges LAN interface not only checks the highorder destination bit, but it also scans the route to see if this bridge
must do forwarding. Only frames that must actually be forwarded
are given to the bridge. This implementation requires the most
complex hardware but wastes no bridge CPU cycles because all
irrelevant frames are screened out.
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Source Routing Bridges
Implicit in the design of source routing bridge is that every machine
in the internetwork knows, or can find, the best path to every other
machine. How these routes are discovered is an important part of
the source routing bridge.
The basic idea is that if a destination is unknown, the source issues a
broadcast frame asking where it is. This discovery frame is forwarded
by every bridge so that it reaches every LAN on the internetwork.
When the reply comes back, the bridges record their identity in it, so
that the original sender can see the exact route taken and ultimately
choose the best route.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Source Routing Bridges
While this algorithm clearly finds the best route (it finds all routes),
it suffers from a frame explosion.

3N-1 frames here.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Comparison of 802 Bridges

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Remote Bridges

Point to point protocol used between bridges:


1. Choose some standard point-to-point protocol, putting complete MAC
frames in the payload field (best if all LANs are identical)
2. Strip off the MAC header at source bridge, put back at destination
(can not catch errors caused by bad bridge memory)

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Repeaters, Hubs, Bridges, Switches, Routers, and Gateways

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Repeaters, Hubs, Bridges, Switches, Routers, and Gateways

Hub

Bridge

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Switch

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Virtual LANs

A building with centralized wiring using hubs and a switch.


Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Virtual LANs

(a) Four physical LANs organized into two VLANs, gray and white, by
two bridges. (b) The same 15 machines organized into two VLANs
by switches.
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Virtual LANs: 802.1Q Standard

Transition from legacy Ethernet to VLAN-aware Ethernet. The shaded


symbols are VLAN aware. The empty ones are not.
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

4.7 Datalink Layer Switching


Virtual LANs: 802.1Q Standard

The 802.3 (legacy) and 802.1Q Ethernet frame formats.

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

Summary

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

High-Level Data Link Control


(HDLC)
HDLC was defined by ISO for use on both point-topoint and multipoint data links.
It supports full-duplex communication
Other similar protocols are
Synchronous Data Link Control (SDLC) by IBM
Advanced Data Communication Control
Procedure (ADCCP) by ANSI
Link Access Procedure, Balanced (LAP-B) by
CCITT, as part of its X.25 packet-switched
network standard
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

HDLC Overview
Broadly HDLC features are as follows:
Reliable protocol
selective repeat or go-back-N

Full-duplex communication
receive and transmit at the same time

Bit-oriented protocol
use bits to stuff flags occurring in data

Flow control
adjust window size based on receiver capability

Uses physical layer clocking and synchronization


to send and receive frames
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

HDLC Overview

Defines three types of stations


Primary
Secondary
Combined

Defines three types of data transfer mode


Normal Response mode
Asynchronous Response mode
Asynchronous Balanced mode

Three types of frames


Unnumbered
Information
Supervisory
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

HDLC
The three stations are :
Primary station
Has the responsibility of controlling the operation of data flow the
link.
Handles error recovery
Frames issued by the primary station are called commands.

Secondary station,
Operates under the control of the primary station.
Frames issued by a secondary station are called responses.
The primary station maintains a separate logical link with each
secondary station.

Combined station,
Acts as both as primary and secondary station.
Does not rely on other for sending data
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

HDLC
Unbalanced Mode

Commands
Primary

Responses
Secondary

Secondary

Balanced mode

Combined

Combined
commands/Respons
es

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

HDLC
The three modes of data transfer operations are
Normal Response Mode (NRM)
Mainly used in terminal-mainframe networks. In this case,
Secondaries (terminals) can only transmit when specifically instructed
by the primary station in response to a polling
Unbalanced configuration, good for multi-point links

Asynchronous Response Mode (ARM)


Same as NRM except that the secondaries can initiate transmissions
without direct polling from the primary station
Reduces overhead as no frames need to be sent to allow secondary
nodes to transmit
Transmission proceeds when channel is detected idle , used mostly in
point-to-point-links

Asynchronous Balanced Mode (ABM)


Mainly used in point-to-point links, for communication between
combined stations
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

Data Link Control HDLC frame


structure
(a) Frame
Format

(b) Control
field
format

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

Data Link Control


HDLC frame structure

(c) Extended address field (d) Extended control field

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

HDLC

Flag: 01111110- start and ending delimiter. Bits are stuffed for flags in
data frames

FCS: 16-bit CRC using generating polynomial


G(x) = x16 + x12 + x5 + 1

Address field:
mainly used in multidrop link configuration, and not used in point-to-point
In unbalanced configuration, every secondary is assigned a unique address.
Contains address of secondary station in both command and response frames
In balanced mode, command frame has destination address and response
frame has sending nodes address
Group addresses are also possible. E.g., One command sent to all the
secondaries

In I-frames, N(s) is the sequence number of the frame being sent, and
R(s) is the sequence number of the frame being expected.

The P/F bit, known as the poll/final bit, is used with different meaning in
different contexts.
It is used to indicate polling, to indicate the final I-frame, etc
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

HDLC
There are three different classes of frames
used in HDLC
Unnumbered frames, used in link setup and
disconnection, and hence do not contain ACK.
Information frames, which carry actual
information. Such frames can piggyback ACK in
case of ABM
Supervisory frames, which are used for error
and flow control purposes and hence contain
send and receive sequence numbers
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

HDLC
There are four different supervisory frames
SS=00, Receiver Ready (RR), and N(R) ACKs all
frames received up to and including the one with
sequence number N(R) - 1
SS=10, Receiver Not Ready (RNR), and N(R) has
the same meaning as above
SS=01, Reject; all frames with sequence number
N(R) or higher are rejected, which in turns ACKs
frames with sequence number N(R) -1 or lower.
SS=11, Selective Reject; the receive rejects the
frame with sequence number N(R)
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

HDLC
The unnumbered frames can be grouped
into the following categories:
Mode-setting commands and responses
Recovery commends and responses
Miscellaneous commands and responses

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

PPP Design Requirements [RFC


1557]
Functionality : (similar to link layer services +
extra management functions)
Packet framing - encapsulation of networklayer datagram in data link frame
Multi-protocol - carry network layer data of
any network layer protocol (not just IP) at
same time ability to demultiplex upwards
Bit transparency - must carry any bit pattern
in the data field (even if underlying channel
can't)
Error detection - not correction
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

PPP Design Requirements (cont.)


The extra stuff:
Connection liveness: detect, signal link failure to
network layer
Network layer address negotiation: endpoint can
learn/configure each others network address and
other characteristics.
Authentication: who are you (or at least whose
account do I bill for your dial-in time?)
This information is used by traffic management
software to control bandwidth to individual
subscribers
Mukesh Patel School of Technology Management and
Rejo Mathew, Asst Prof,
Management
features:
loopback detection
Engineering
www.nmims.edu/Engineering
IT

PPP non-requirements
No error correction/recovery
(modems do one layer FEC, one layer
packetization + retransmission under the
covers anyway; other technologies are pretty
reliable)
No flow control
Out of order delivery OK
Error recovery, flow control, data re-ordering
all relegated to higher layers!
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

PPP Data Frame


Flag: delimiter (framing)
Address: ignored. (historical)
Control: ignored. (historical)
Protocol: upper layer protocol to which frame
delivered (e.g., PPP-LCP, IP, IPCP, etc)

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

PPP Data Frame


info: upper layer data being carried
check: cyclic redundancy check for error
detection

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

Byte Stuffing
flag byte
pattern
in data
to send

flag byte pattern plus


stuffed byte in
transmitted data
Mukesh Patel School of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

PPP Data Control Protocol


Before exchanging networklayer data, data link peers
must
Configure PPP link (max.
frame length,
authentication)
Learn/configure network
layer information
for IP: carry IP Control
Protocol (IPCP) msgs
(protocol field: 8021) to
Mukesh Patel School
configure/learn
IP of Technology Management and
Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

Where does PPP get used?


Dial-up PPP over async serial, over modem
ADSL PPP over Ethernet
Backbone Packet over SONET (POS)
Why?
Framing (dialup, POS)
Efficiency (POS)
Authentication, address negotiation (PPPoE)

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

Introduction to ATM,X.25 and Frame


Relay
ATM has four important differences from frame
relay:
ATM uses fixed packet lengths of 53 bytes (5 bytes of overhead
and 48 bytes of user data), which is more suitable for voice
transmissions.
ATM provides extensive quality of service information that
enables the setting of very precise priorities among different types
of transmissions (i.e. voice, video & email; services include CBR,
VBR, ABR and UBR).
ATM is scalable. It is easy to multiplex basic ATM circuits into
much faster ATM circuits.
ATM provides connection-oriented services only.

An ATM cell

ATM layers in endpoint devices


and switches

X.25
In case of packet switching networks, the attached
stations must organize their data into packets for
transmission.
This requires a certain level of cooperation
between the network and the attached stations.
X.25 is an ITV-T standard that specifies on
interface between a host system and packet
switching network.
The functionality of X.25 is specified in three levels
they are:
Physical level
Link Level

X.25
Physical level:
Physical level deals with the physical interface between an
attached station and the link that attaches that station to
the packet switching node.
Link level:
The link level provides for the reliable transfer of data across
the physical link, by transmitting the data as a sequence of
frames.
The link level standard is referred to as LAPB (link access
protocol balanced)LAPB is subset of HDLC.
Packet level:
The packet level provides a virtual circuit service.
This service enables any subscriber to the network to setup
logical connections called virtual circuits, to other
subscribers.

X.25

Format of a Frame in X.25

Frame Relay

Frame relay is designed to provide more


efficient transmission than X.25.
The traditional approach of packet switching
makes use of X.25.
1.Multiplexing of virtual circuits takes place
at layers
2.Both layer 2 and 3 include flow control and

Frame relay Network

Frame relay frame

Comparing Layers in Frame Relay


and X.25

Mukesh Patel School of Technology Management and


Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof,


IT

Das könnte Ihnen auch gefallen