Вы находитесь на странице: 1из 79

Unit-III (Contd.

)
The Medium Access Control
Sub layer

The Medium Access Sublayer


Deals with broadcast networks and their protocols.
The key issue is how to determine who gets to use the
channel when there is competition for it.
Also called multiaccess channels or random access
channels.
The protocols determine who goes next on a
multiaccess channel.
Bottom part of the data link layer.

The Channel Allocation Problem

How to allocate a single broadcast channel among


competing users?
Ways:
Static Channel Allocation
Dynamic Channel Allocation

Static Channel Allocation


FDM: Frequency Division Multiplexing
TDM: Time Division Multiplexing
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.

Contd.
A simple queuing theory calculation
For a channel of capacity C bps, with an arrival rate of
frames/sec, each frame having a length drawn from an
exponential probablity density function with mean 1/
bits/frame, the mean time delay
1

Now let us 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
1
TFDM
NT
(C / N ) ( / N )
5

Dynamic Channel Allocation


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.
6

Dynamic Channel Allocation in LANs and MANs

Five key assumptions:


2. Single Channel Assumption. A single channel is available
for all communication. All stations can transmit on it and
all can receive from it.
As far as the hardware is concerned, all stations are
equivalent, although some protocol software may assign
priorities to them.

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 later. There are no errors other than those
generated by collisions.

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.

Dynamic Channel Allocation in LANs and MANs


Five key assumptions:
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 they determine whether or not the
transmission was successful.

10

Multiple Access Protocols


ALOHA
Carrier Sense Multiple Access Protocols
Collision-Free Protocols

11

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

12

Pure ALOHA

Frames are transmitted at completely


arbitrary times.

13

Pure ALOHA

Nodes transmit on a common channel.


Transmit frames of fixed length.
When two transmissions overlap, they garble each other
(collision)
Feedback property is there.
If the frame gets destroyed, the sender waits a random
amount of time and sends it again.
Continues till successful transmission.

14

How efficient ALOHA is ?


nodes
new frame

channel

collision?

old frame

No

Yes

G: the mean number of transmission attempts


(new and old combined)

S G P0
where P0 is the probability that a frame does not suffer a collision

15

Pure ALOHA
Vulnerable period for the shaded frame.

16

New frames generated by the stations are well modeled by a Poisson


distribution with mean number of N frames per time.
If N>1 ( i.e. the users community is generating frames at a higher rate
than the channel can use.)
For reasonable throughput

17

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.


18

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.

19

Pure ALOHA
Throughput versus offered traffic for ALOHA
systems.

The best channel utilization:


Pure ALOHA = 0.184, Slotted ALOHA = 0.368.

20

Carrier Sense Multiple Access Protocols

In local area networks, 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.

21

Carrier Sense Multiple Access Protocols


1-persistent CSMA: the station transmits with a probability of 1
whenever it finds the channel idle, if the channel is busy, it waits
until it becomes idle
Non-persistent CSMA: the station transmits if the channel is idle,
if the channel is busy, it waits a random time and tries again
p-persistent CSMA (slotted): the station transmits with a
probability of p whenever it finds the channel idle, with a
probability of 1-p, it waits until the next slot. If another station
has begun transmitting, it acts as if there had been a collision. It
waits a random time and starts again.
22

Behavior of three persistence methods

23

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.

24

A conceptual model for CSMA/CD

25

maximum collision detection time


A
1.A starts
transmitting

3. A reaches B
5.B reaches A

2PROP

B
t=0

2.B starts
transmitting
PROP

4.B detects collision,


stops

6.A detects collision,


stops
The maximum collision detection time is equal to
twice the maximum end-to-end propagation delay.
26

Contd.
So, contention interval width is 2 ( is the end to end delay).
On a 1-km long coaxial cable, 5sec.
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).
Collisions do not occur with CSMA/CD once a station has
unambiguously seized the channel, But still occur during the
contention period.
Collisions adversely affect the system performance,
especially when the cable is long and the frames are short.

27

Collision-Free Protocols
Assumption: There are N stations, each with a unique address from 0
to N-1.
A Bit-Map protocol

Protocols, in which the desire to transmit is broadcast before the


actual transmission are called reservation protocols.
28

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)

29

Binary Countdown

Stations binary
address

A dash
indicates
silence.

30

Binary Countdown
The channel efficiency of this method is d/(d+log2N).
If the frame format is chosen such that the senders address
is the first field in the frame, the efficiency is 100%.
Variations (by Mok and Ward): 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
31

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

good
bad

channel
efficiency
Heavy load
bad
good

32

Limited-Contention Protocols

Better to combine the best properties of the contention and


collision-free protocols, arriving at a new protocol that uses
contention at low loads to provide low delay, but uses a
collision-free technique at high load to provide good channel
efficiency.
Such protocols are called limited contention protocols.

33

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.

34

Contd.
The adaptive tree walk protocol
Slot 0

Slot 1 (if collision)

Depth first search


for all ready
stations

35

Important Point:
When the load on the system is heavy,
Not 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, nodes 2 and 3 should be skipped as well for the same
reason.
In more general terms, at what level in the tree should the
search begin?

36

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.
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.
So, i=log2q.
37

Numerical: Sixteen stations, numbered 1 through


16, are contending for the use of a shared channel
by using the adaptive tree walk protocol. If all the
stations whose addresses are prime numbers
suddenly become ready at once, how many bit slots
are needed to resolve the contention?

38

IEEE standards

39

IEEE standard for LANs

40

Ethernet evolution through four generations

41

IEEE 802.3 (Ethernet): Ethernet refers to cable


Uses 1-persistent CSMA/CD
Uses Manchester / Differential Encoding

Cabling:

42

Three kinds of Ethernet cabling.


(a) 10Base5- 50mtr., T Cable contains 5 twisted pairs (2 data
In/Out, 2- control In/Out, 1- Power supply), Controller (Frames
to & from Transceiver)
(b) 10Base2- T Junction Connector,
(c) 10Base-T- No shared Cable
43

To allow larger networks, multiple cables can be connected by


repeaters.
A repeater is a physical layer device. It receives, amplifies, and
retransmits 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.

44

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

802.3 Frame Format

46

802.3 Frame Format


Preamble: Contains 10101010 to synchronize the clocks.
Start Byte: 10101011
Length: How many bytes 0 to 1500, 0 bytes is legal but may cause
problem in Collision Detection., (64 bytes min Frame Size).
Pad: to make Frame size at least 64 bytes.
Checksum: CRC
0 single address
1 group address

multicast (all 1's for broadcast

0 local address

No significance outside
46
1 global address one of 2 unique address
47

Minimum frame length: 64 bytes (10Mbps LAN, 2.5 Km

48

The Binary Exponential Back off Algorithm


How Randomization is done when a Collision Occurs?
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
49

Token Bus
Token passed from 4 to 1

Logical Ring

50

Token Ring

51

Token Passing

52

Token Passing

53

Token Passing

54

Token Passing

55

Taxonomy of switched networks

56

Switching
Circuit Switching: When a call passes through a switching
office, a physical connection is established between the line
on which the call came in and one of the output lines.
Message switching: No physical path is established in
advance. Block of data is transmitted using store-andforward technique.

Packet Switching: No physical path. It places a tight upper


limit on block size, allowing packets to be buffered in router
main memory instead of on disk.

57

Circuit Switching
Circuit switching takes place at the physical layer.
Before starting communication, the stations must make a reservation for
the resources to be used during the communication.
These resources, such as channels (bandwidth in FDM and time slots in
TDM), switch buffers, switch processing time, and switch input/output
ports, must remain dedicated during the entire duration of data transfer
until the teardown phase.
Data transferred between the two stations are not packetized. The data
are a continuous flow sent by the source station and received by the
destination station.
There is no addressing involved during data transfer. The switches route
the data based on their occupied band (FDM) or time slot (TDM). There
is end-to-end addressing used during the setup phase.

58

Circuit Switching

(a) Circuit switching.


(b) Packet switching.
59

Message Switching

(a) Circuit switching

(b) Message switching (c) Packet switching60

Packet Switching

A comparison of circuit switched and packet-switched networks.


61

Delay in a circuit-switched network

62

Delay in a datagram network

63

Virtual Circuits
As in a circuit-switched network, there are setup and teardown phases in
addition to the data transfer phase.
Resources can be allocated during the setup phase, as in a circuit-switched
network, or on demand, as in a datagram network.
As in a datagram network, data are packetized and each packet carries an
address in the header. The address in the header has local jurisdiction (it
defines what should be the next switch and the channel on which the
packet is being carried), not end-to-end jurisdiction.
All packets follow the same path established during the connection.
A virtual-circuit network is implemented in the data link layer, while a
circuit-switched network is implemented in the physical layer and a
datagram network in the network layer. But this may change in the future.

64

Delay in a virtual-circuit network

65

Implementation of Connectionless Service

Routing within a datagram subnet.

66

Implementation of Connection-Oriented Service

Routing within a virtual-circuit subnet.

67

In virtual-circuit switching, all packets


belonging to the same source and
destination travel the same path;
but the packets may arrive at the destination
with different delays
if resource allocation is on demand.

68

Comparison of Virtual-Circuit and Datagram Subnets


5.1.2 Internal Organization of the Network Layer

69

Public Switched Telephone Network


(PSTN)
Structure of the Telephone System
The Local Loop: Modems and ADSL

70

Structure of the Telephone System

(a) Fully-interconnected network.


(b) Centralized switch.
(c) Two-level hierarchy.
71

Structure of the Telephone System

A typical circuit route for a medium-distance call.


72

Major Components of the Telephone


System
Local loops
Analog twisted pairs going to houses and businesses
Trunks
Digital fiber optics connecting the switching offices
Switching offices
Where calls are moved from one trunk to another

73

The Local Loop: Modems and ADSL

The use of both analog and digital transmissions for a computer to computer call.
Conversion is done by the modems and codecs.

74

Contd.
The two-wire local loop coming from a telephone company end
office into houses and small businesses.
uses analog signaling. (due to high cost of converting to digital).
When a computer wishes to send digital data over an analog dialup line, the data must first be converted to analog form for
transmission over the local loop. (done by a modem)
At the telephone company end office the data are converted to
digital form for transmission over the long trunks. (by codec)
Analog signaling consists of varying a voltage with time to
represent an information stream.
As media are not perfect, so the received signal is not the same as
the transmitted signal. For digital data, this difference can lead to
errors.
75

Digital subscriber line (DSL)


With the advent of the Internet came the need for high-speed
downloading and uploading; the modem was too slow. The
telephone companies added a new technology, the digital
subscriber line (DSL).
Although dial-up modems still exist all over the world, DSL
provides much faster access to the Internet through the
telephone network.
Asymmetric DSL(ADSL) uses the existing local loops.
Twisted-pair local loop is actually capable of handling
bandwidths up to 1.1 MHz, but the filter installed at the end
office of the telephone company where each local loop
terminates limits the bandwidth to 4 kHz (sufficient for voice
communication). If the filter is removed, however, the entire
1.1 MHz is available for data and voice communications.
76

T1 Carrier

77

T1 Carrier
The method used in North America and Japan is the T1 carrier.
The T1 carrier consists of 24 voice channels multiplexed
together.
The analog signals are sampled on a round-robin basis with
the resulting analog stream being fed to the codec rather than
having 24 separate codecs and then merging the digital output.
Each of the 24 channels, in turn, gets to insert 8 bits into the
output stream. Seven bits are data and one is for control.

78

Numerical
What is the percent overhead on a T1 carrier;
that is , what percent of the 1.544Mbps are
not delivered to the end user?

79

Вам также может понравиться