Computer Networks - MAC
Computer Networks - MAC
Chapter 4
Medium Access Sublayer
Feb 11 Exam 1
Chap. 4- MAC 2
Chapter Overview
Here we want to know how to handle broadcast networks. As compared to
point to point networks, a major issue is handling arbitration when there is
competition for the network.
This is the bottom sublayer of the Data Link Layer. This Chapter is especially
relevant for LANs.
4.1 The Channel Allocation Problem
How to allocate a single channel among multiple users.
4.2 Multiple Access Protocols
How to handle contention for the use of a channel.
4.3 IEEE Standards for LANs
How do the protocols of the last sections apply to real systems. Here we talk
about the actual standards in use.
4.4 Bridges
Ways of connecting networks together.
4.5 High Speed LANs
Directions in high speed networks.
Chap. 4- MAC 3
CHANNEL Overview
ALLOCATION
PROBLEM:
4.1 The Channel Allocation Or, how to allocate a single channel among
Problem competing users.
4.2 Multiple Access Protocols
4.3 IEEE Standards for LANs
4.4 Bridges
4.5 High Speed LANs
Chap. 4- MAC 4
CHANNEL STATIC CHANNEL
ALLOCATION ALLOCATION IN LANs AND
PROBLEM: MANS
Inefficient to divide into fixed number of chunks. May not all be used, or may
need more. Doesn't handle burstiness.
Chap. 4- MAC 6
CHANNEL DYNAMIC CHANNEL
ALLOCATION ALLOCATION
PROBLEM:
Possible underlying assumptions include:
Station Model -
There's only one channel; all stations are equivalent and can send and receive on that
channel.
Collision Assumption -
If two frames overlap in any way time-wise, then that's a collision. Any collision is an
error, and both frames must be retransmitted. Collisions are the only possible error.
Chap. 4- MAC 7
CHANNEL DYNAMIC CHANNEL
ALLOCATION ALLOCATION
PROBLEM:
Continuous Time -
There's no "big clock in the sky" governing transmission. Time is not in discrete
chunks.
Slotted Time -
Alternatively, frame transmissions always begin at the start of a time slot. Any
station can transmit in any slot (with a possible collision.)
Carrier Sense -
Stations can tell a channel is busy before they try it. NOTE - this doesn't stop
collisions. LANs have this, satellite networks don't.
Chap. 4- MAC 8
Overview
Multiple Access
Protocols
4.1 The Channel Allocation How to handle contention for the use of a channel.
Problem
4.2 Multiple Access Protocols
4.3 IEEE Standards for LANs
4.4 Bridges
4.5 High Speed LANs
Chap. 4- MAC 9
Multiple Access MULTIPLE ACCESS
Protocols PROTOCOLS
Collisions work well for low utilization (they're not likely to happen.) Arbitration, which we'll
talk about later, works better at high utilization.
ALOHA:
PURE ALOHA:
Every station transmits whenever it wants to. Colliding frames are destroyed. The sender
knows if its frame got destroyed, and if so waits a random time and then retransmits.
Chap. 4- MAC 10
Multiple Access MULTIPLE ACCESS
Protocols PROTOCOLS
• S = frames to be transmitted. In units of frames per frame time so that 0 < S < 1.
(What is the meaning of frame time as used here??)
• G = S + frames retransmitted due to previous collisions.
• P0 = probability that a frame does NOT suffer collision. Pure Aloha
• S = P0 x G Continued
Use the Figure to determine collision vulnerability.
Chap. 4- MAC 11
Multiple Access MULTIPLE ACCESS
Protocols PROTOCOLS
Probability that k frames are generated during a given frame time (Poisson distribution):
G k e-G
Pr[k] = -------------- Pure Aloha
k! Continued
Probability of no traffic initiated during the vulnerable period:
P0 = e-2G so
S = G e -2G
See Figure 4.3
Chap. 4- MAC 12
MULTIPLE ACCESS
Multiple Access PROTOCOLS
Protocols
SLOTTED ALOHA:
Doubles efficiency by dividing time into "ticks". Sends occur only at the start of a
tick. Vulnerable period is 1/2 of pure Aloha case, so
S = G e-G
Chap. 4- MAC 13
Multiple Access CARRIER SENSE MULTIPLE
Protocols ACCESS PROTOCOLS:
This is where the sender listens before ejecting something on the wire. Collision occurs
when a station hears something other than what it sent.
1-persistent CSMA
Station listens. If channel idle, it transmits. If collision, wait a random time and try again.
If channel busy, wait until idle.
Success here depends on transmission time - how long after the channel is sensed as idle
will it stay idle (there might in fact be someone else's request on the way.)
Same as above EXCEPT, when channel is found to be busy, don't keep monitoring to find
THE instant when it becomes free. Instead, wait a random time and then sense again.
Leads to
1) better utilization and Chap. 4- MAC 14
2) longer delays than 1 - persistent. (why?)
Multiple Access CARRIER SENSE MULTIPLE
Protocols ACCESS PROTOCOLS:
Nonpersistent CSMA (equivalent to 0-persistent CSMA)
Same as above EXCEPT, when channel is found to be busy, don't keep monitoring to find THE
instant when it becomes free. Instead, wait a random time and then sense again.
Leads to
1) better utilization and
2) longer delays than 1 - persistent. (why?)
Chap. 4- MAC 15
Multiple Access CARRIER SENSE MULTIPLE
Protocols ACCESS PROTOCOLS:
What is contention interval -- how long must station wait after it sends until it
knows it got control of the channel? It's twice the time to travel to the furthest
station.
Chap. 4- MAC 16
Multiple Access COLLISION-FREE
Protocols PROTOCOLS
How long is a packet (or how long a wire is needed to contain a packet) of length 1500
bytes on a 100 Mbps ethernet?
As cables become longer and faster, the above methods become less efficient. So, . . . .
A "contention slot", subdivided into bits, allows each station to announce that it wants to
send. After the announcement, all stations can send in priority order, and there will be
no fighting over the channel. Called "reservation protocol".
What are pros and cons of this method? Analyze at low and high loads.
Binary Countdown -
In the contention slot, each station places its ID. They all get or’d on top of each other.
A particular station knows if it won because no wanting-to-send station had a higher
number than it did in the slot. ( For instance, 101101 OR 110011 : The 101101
station knows it lost by the time it sends its second bit - it sees a “1” on the wire when it
just sent out a “0”, so it knows the game is up.
Chap. 4- MAC 17
Multiple Access LIMITED-CONTENTION
Protocols PROTOCOLS:
Collision techniques work well for low utilization (they're not likely to happen.)
Arbitration, which we'll talk about later, works better at high utilization. This
method provides best of these techniques.
Divide the stations up into groups. Stipulate that only members of group 0 can
arbitrate for slot 0, members of group 1 for slot 1, etc. Works because it cuts
down on the contention felt by any particular station.
Want a method that will have many members per group at low contention, and
few (or one) member at high contention. Can use a binary search to do this.
Chap. 4- MAC 18
Multiple Access Wireless LAN Protocols
Protocols IEEE 802.11
Physical Properties:
The spec allows running over three possible media
• Radio using frequency hopping
• Radio using direct sequencing
• Infrared over short distances ( 10 meters )
Chap. 4- MAC 19
Multiple Access Wireless LAN Protocols
Protocols IEEE 802.11
Frequency Hopping:
• Transmit the signal over a pseudo-random sequence of frequencies.
1st one frequency, then a second, etc. The sender and receiver are
using the same random number generator so they can stay in sync.
• The spec calls for using 79 different 1 MHz wide bandwidths.
Direct Sequence:
• Each bit of data is replaced by multiple bits in the signal.
• Transmitter sends the exclusive or of the data, PLUS n random bits.
• Again, both the sender and receiver know the random sequence.
Chap. 4- MAC 20
Multiple Access Wireless LAN Protocols
Protocols IEEE 802.11
A.
B.
C.
A. Data Stream 1 0 1 0
B. Random Sequence 0100101101011001
C. XOR of the two: 1011101110101001
Chap. 4- MAC 21
Multiple Access Wireless LAN Protocols
Protocols IEEE 802.11
Collision Avoidance:
• Similar to Ethernet, but not quite the same.
• But more complicated because all nodes don’t see each other.
Sender and receiver exchange control frames so the transaction goes like this:
• Sender (A) does Request to Send (RTS) to receiver(B)
• B sends back Clear to Send (CTS)
• A sends packet.
• B sends an ACK after receiving the frame. C can “see” this range
Logic:
• If a node hears the CTS, it knows it is
near the receiver - so don’t transmit.
• If a node hears the RTS but not the CTS, A. B. C. D.
it’s not near the receiver so it can
start its own transaction.
Nodes
Chap. 4- MAC 24
Multiple Access Wireless LAN Protocols
Protocols IEEE 802.11
Distribution System:
16 16 48 48 48 16 48 0-2313 32
Chap. 4- MAC 26
IEEE Standard 802 Overview
For LANs and
MANs
4.1 The Channel Allocation How do the protocols of the last sections
Problem apply to real systems. Here we
talk about the actual standards in
4.2 Multiple Access Protocols use.
4.3 IEEE Standards for LANs
802.2 Describes the upper part of the data
4.4 Bridges link layer, the LLC (Logical Link
4.5 High Speed LANs Control).
Chap. 4- MAC 27
IEEE STANDARD 802.3: ETHERNET
IEEE Standard 802
This is a 1-persistent CSMA/CD LAN. Originated in Aloha.
WIRES:
Chap. 4- MAC 28
IEEE STANDARD 802.3: ETHERNET
IEEE Standard 802
Wiring
Repeaters - Multiple
cables can be
connected. From
software point, a
repeater is
transparent.
Chap. 4- MAC 29
Manchester Encoding
IEEE Standard 802
Life would be easy if:
binary 0 = 0 volts
binary 1 = 5 volts
But there's no way to distinguish a 0 from nothing-happening. Need to know
when is middle of bit WITHOUT a clock.
Chap. 4- MAC 30
802.3 MAC SUBLAYER PROTOCOL
IEEE Standard 802
Preamble == 7 bytes of 10101010
Packet Definition
Start == 1 byte of 10101011
Dest == 6 bytes of mac address
multicast == sending to a group of stations.
broadcast == (dest. = all 1's) to all stations on network
Source == 6 bytes of mac address
Length == number of bytes of data
Data == comes down from network layer
Pad == ensures 64 bytes from dest addr thru checksum.
The pad ensures transmission takes enough time so it's still being sent when
the first bit reaches the destination. The frame needs to still be going out
when the noise burst from another stations collision detection gets back to
the sender.
checksum == 4 bytes of CRC.
Chap. 4- MAC 31
802.3 MAC SUBLAYER PROTOCOL
IEEE Standard 802
Packet Definition
Chap. 4- MAC 32
802.3 MAC SUBLAYER PROTOCOL
IEEE Standard 802
BINARY EXPONENTIAL BACKOFF ALGORITHM:
After a collision, station waits 0 or 1 slot. If it collides again while doing this
send, it picks a time of 0,1,2,3 slots. If again it collides the wait is 0 to 2 3
-1 times. Max time is 210 -1 (or equal to 10 collisions.) After 16 collisions,
an error is reported.
Slot is determined by the worst case times; 500 meters X 4 repeaters = 512
bit times = 51.2 microseconds.
500 m Rep 500 m Rep 500 m Rep 500 m Rep
500 m
Chap. 4- MAC 33
802.3 PERFORMANCE
IEEE Standard 802
1
channel efficiency = ---------------------
1 + 2BLe/cF
Note: Efforts focus on improving both B and L, both of which will decrease efficiency.
Note on traffic patterns; arrivals are not Poisson, but self similar. This means that
fluctuations occur on any observation scale (kind of like fractals.)
Chap. 4- MAC 34
Switched 802.3 LANs
IEEE Standard 802
Uses 10Base-T to each of the hosts. And a high speed backplane between
the connectors. Works because the assumption is that many requests
can be routed within the switch. Relieves congestion on the hub.
Routing -
Local (on-switch) destinations are sent there directly. Off-switch are sent to
the backplane.
Collision Detection -
The connections on the switch
form their own LAN and do
collision handling as we've
just seen. The switch buffers
the transmission and ensures
no collisions occur.
Chap. 4- MAC 35
IEEE STANDARD 802.4: TOKEN BUS:
IEEE Standard 802
Need a mechanism to handle real-time, deterministic requirements. 802.3 could
contend forever and this is often not acceptable.
A ring, with stations taking turns is deterministic. Uses logical ring on linear cable.
Mechanism -
o All stations numbered; station knows # of its neighbors.
o A token, required in order to send, is initialized by the highest number
station.
o A station, receiving the token, does a send if it has a request, then sends
the token to its logical (not necessarily physical) neighbor.
Activation -
o Stations can come and go on the bus, without breaking mechanism.
Cabling -
o Uses 75 ohm coax. Speeds are 1, 5, 10 Mbps.
Chap. 4- MAC 36
IEEE STANDARD 802.4: TOKEN BUS:
IEEE Standard 802
TOKEN BUS MAC SUBLAYER PROTOCOL:
Proper setting of the various timers ensures that high priority requests happen first.
Chap. 4- MAC 37
IEEE STANDARD 802.4: TOKEN BUS:
IEEE Standard 802
The frame format. Fields are:
Chap. 4- MAC 38
TOKEN BUS:
IEEE Standard 802 LOGICAL RING MAINTENANCE
SOLICIT_SUCCESSOR -
Gives sender’s address and the current successor's address. Stations not in the ring,
with address between these two are invited to bid to be inserted.
No response within given time ==> go on as before.
One response ==> newcomer is inserted; becomes new successor.
Two or more responses ==> answers collide so garbled.
Chap. 4- MAC 39
TOKEN BUS:
IEEE Standard 802 LOGICAL RING MAINTENANCE
control frames for ring maintenance.
RESOLVE_CONTENTION -
Causes responding stations to NOT immediately try to be successors, but use binary countdown by 0, 1, 2, or 3 slots. Mechanism also ensures that traffic isn't
slowed down by solicitation.(limited to less frantic times.)
SET_SUCCESSOR -
Used by a leaving station. Sent to the predecessor to say the leaver's successor is now the predecessor's successor.
WHO_FOLLOWS -
The token sender listens to make sure the successor got and then passed on the token. If doesn't happen, it sends a WHO_FOLLOWS and failed station's
successor sends a SET_SUCCESSOR to the failed one's predecessor.
SOLICIT_SUCCESSOR_2 -
The token sender can't find the successor and there's no response from WHO_FOLLOWS; This causes ALL stations to once again bid for a place in the ring -
this is like starting from scratch.
CLAIM_TOKEN -
If the token holder crashes, then nothing appears on the ring. All station's timers go off and the contention algorithm determines who gets to generate the
token.
Chap. 4- MAC 40
IEEE STANDARD 802.5: TOKEN RING
IEEE Standard 802
In addition, there's a 1 bit delay at each station. (Data bit can be modified before being
forwarded.)
• Listen mode -
• Input just copied to output.
•
• Transmit mode -
• Seize the token and put own data on ring. As sender's data comes back around, it removes data.
At end of transmission, stick token back on. Receiver can ACK receipt by flipping a bit on end of
packet.
• Efficiency is excellent: At high usage, with many stations transmitting, they get token one after the
other.
Chap. 4- MAC 42
IEEE STANDARD 802.5: TOKEN RING
IEEE Standard 802
Wires -
Shielded twisted pair/ 1 or 4 Mbps.
Differential Manchester encoding.
Reliability -- Star Shaped Ring --
Chap. 4- MAC 43
TOKEN RING MAC SUBLAYER
IEEE Standard 802 PROTOCOL:
Frame Structure Components -
Source/Destination addresses/checksum
same as 802.3 & 802.4.
Chap. 4- MAC 44
TOKEN RING MAC SUBLAYER
IEEE Standard 802 PROTOCOL:
Frame Structure Components -
Frame status
A bit - the intended receiver saw the packet
C bit - the receiver copied the packet into its buffers.
Serves as acknowledgment.
Priorities -
Token gives priority of that token - a sender must wait for token of correct priority.
The access control byte (of the token or data frame) has reservation bits. As
frame goes by, a requester can say it wants the token at that priority the next time
around.
Chap. 4- MAC 45
TOKEN RING MAC SUBLAYER
IEEE Standard 802 PROTOCOL:
RING MAINTENANCE:
Monitor station oversees the ring, but on failure any station can become monitor.
CLAIM_TOKEN is a request to become the new monitor.
Monitor oversees:
• .Lost token management - If timer says token not seen in a while, produce new one.
• .Orphan frames - (Frame on ring, but sender crashes before draining frame.) Sets "monitor" bit in access
control byte. If this bit seen as set the next time around, then something is wrong.
• .Garbled frame - Monitor drains the frame and issues new token.
• .Delay time - Ensures enough delay so whole token fits on ring.
Broken rings handled by any station who thinks neighbors unreachable. Uses BEACON control type.
Token management handled by the monitor so not de-centralized. Management easier, but susceptible to berserk behavior.
Chap. 4- MAC 46
COMPARISONS OF 802.3, 802.4,
IEEE Standard 802 AND 802.5:
POSITIVES NEGATIVES
In great scheme of
things, differences 802.3 Large installed base. Has analog requirements.
Simple protocol. Must detect possible weak remote station.
are small. All three Good configurability.
have approximately Passive and cheap cable. Minimum size = 64 bytes.
Low latency (no waiting Non-deterministic/no priorities.
same technology and for token.) Short cable length.
speed. Efficiency drops at higher speeds.
Chap. 4- MAC 47
IEEE 802.2: Logical Link Control
IEEE Standard 802
LLC
For when a reliable error-controlled flow-
controlled data link protocol is required.
4.1 The Channel Allocation This is one way that networks are
Problem connected together.
4.2 Multiple Access Protocols Bridges operate in the data link layer, and
4.3 IEEE Standards for LANs so don’t have the intelligence to do
much address resolution.
4.4 Bridges
4.5 High Speed LANs What we will talk about here -
Chap. 4- MAC 49
The Big Picture
BRIDGES
Chap. 4- MAC 50
The Big Picture
BRIDGES
Chap. 4- MAC 51
From 802.x to 802.y
BRIDGES
Issues -
• Each LAN type has its own frame format. Bridges take off one type and put on
another. <<< Figure 4.36 >>>
• LANs don't necessarily run at the same speed, so must reject or buffer the data
• Two input LANs feeding one output LAN.
• Each LAN type has it's own maximum data length. So bridges must do framing in
order to translate.
• Network layers may time out because they expect the destination to ACK within a
given time; all this translating slows down the transmission.
• All LAN types don't carry the same information:
o Priority bits.
o Acknowledgment bits.
Transparent Bridges and Source Routing Bridges are two competing and
mutually exclusive ways of routing packets.
Chap. 4- MAC 53
Bridge Types
BRIDGES
TRANSPARENT BRIDGES:
Also called Spanning Tree Bridges -
Goals:
• "Perfect" transparency. No one needs to do anything. It just works.
• No hardware or software configuration required.
• No switches, no routing tables.
• Stateless (or as stateless as possible.)
Promiscuous mode:
Accepts all packets from all LANs attached to the bridge.
If destination is on incoming LAN, discard the packet.
Otherwise, forward the packet.
Use table (hashed) in bridge to determine choice of the LAN for forwarding.
Chap. 4- MAC 54
Bridge Types
BRIDGES
Chap. 4- MAC 55
Bridge Types
BRIDGES
Parallel Redundant Bridges
(cont):
Algorithm is as follows:
• Each bridge determines cost of the path from the root bridge to each of its ports. (The root path cost.) Cost determined by
number of segments and the bit rate of those segments.
• Determine the root port - for a bridge, which of its ports has the lowest root path cost.
• Determine the designated bridge - the bridge that will handle requests for a particular LAN (even though that LAN may have
several bridges attached to it.) Selection based on smallest path cost from the segment to the root bridge.
Chap. 4- MAC 56
Bridge Types
BRIDGES
SOURCE ROUTING BRIDGES:
Used by IBM/rings. Here the sender holds ALL knowledge of how a packet
should be routed.
Chap. 4- MAC 57
Bridge Types
BRIDGES
SOURCE ROUTING
BRIDGES(cont):
In the figure above, the Path from A to D is L1, B1, L2, B2, L3.
If the source doesn't know the route, it sends a "discovery frame" that goes to every LAN
in the network. The destination replies and each bridge along the way puts its ID in that
reply. The source then knows all that it needs. This discovery produces lots of excess
packets.
Chap. 4- MAC 58
Bridge Types
BRIDGES
COMPARISON OF 802 BRIDGES
Chap. 4- MAC 59
Overview
High Speed LANs
Chap. 4- MAC 60
SUMMARY
Here we want to know how to handle broadcast networks. As compared to
point to point networks, a major issue is handling arbitration when there is
2.1competition
Theoretical Basis
for the For Data Communication
network.
What every sophomore EE knows !!! How much data can be put on a
Thiswire?
is the bottom sublayer
What are of the
the limits Data Link
imposed byLayer. This Chapter is especially
a medium?
relevant for LANs.
2.2 Transmission Media
4.1 The Channel Allocation Problem
Wires and fibers.
How to allocate a single channel among multiple users.
2.3 Multiple
4.2 Wireless Transmission
Access Protocols
Radio, microwave, infrared, unguided by a medium.
How to handle contention for the use of a channel.
4.3
2.4 IEEE
TheStandards
Telephone for LANs
System
How do the protocols of the last sections apply to real systems. Here we talk
Theabout
system
theinvented 100 yearsinago
actual standards to carry voice.
use.
2.5 Narrowband ISDN
4.4 Bridges
Ways of connecting
Mechanisms networks
that can carrytogether.
voice and data.
4.5 High Speed LANs
Directions in high speed networks.
Chap. 4- MAC 61