+ All Categories
Home > Documents > Chapter4 Medium AcMedium Access Controlcess Control

Chapter4 Medium AcMedium Access Controlcess Control

Date post: 02-Jan-2016
Category:
Upload: harsh-bhagat
View: 96 times
Download: 0 times
Share this document with a friend
Description:
mac address
Popular Tags:
28
1 The Medium Access Control Sublayer Chapter 4
Transcript
Page 1: Chapter4 Medium AcMedium Access Controlcess Control

1

The Medium Access ControlSublayer

Chapter 4

Page 2: Chapter4 Medium AcMedium Access Controlcess Control

2

The Channel Allocation Problem• The MAC (Medium Access Control) sublayer is

between the physical layer and the data link layer. • The MAC sublayer is especially important in

LANs, nearly all of which use a multiaccess (or broadcast) channel as the basis of their networks.

1. Static Channel Allocation in LANs and MANs

2. Dynamic Channel Allocation in LANs and MANs

Page 3: Chapter4 Medium AcMedium Access Controlcess Control

3

Static channel allocation • FDM (Frequency-Division Multiplexing):

Divide the bandwidth into equal sized portions so that each user can be assigned one portion.

• Under what circumstances FDM is efficient ?

When there is only a small and fixed number of users, and each of which has a heavy (buffered) load of traffic (e.g., carriers' switching offices).

• What's the problem with FDM ? 1. If fewer than N users are currently interested in communication, some

portions of spectrum will be wasted.

2. If more than N users want to communicate, some of them will be denied permission even if some users with allocated frequency hardly ever transmit anything.

3. Even the number of users is N and constant, when some users are quiescent, no one else can use their bandwidth so it is simply wasted.

Page 4: Chapter4 Medium AcMedium Access Controlcess Control

4

Dynamic Channel Allocation in LANs and MANs

1. Station Model.• Independent stations for generating frames.

• Once a frame has been generated, the station is blocked until the frame has been transmitted.

2. Single Channel Assumption. A single channel for all communication (send and receive), and all stations are equivalent.

3. Collision Assumption. If the transmission of two frames overlap in time, a collision occurs. All stations can detect collisions. A collided frame must be retransmitted.

4. Time assumption. (a) Continuous Time.

(b) Slotted Time.

5. Sense assumption. (a) Carrier sense. Stations can tell if the channel is in use before trying to use it. (b) No carrier sense. Stations cannot sense the channel before trying to use it.

Page 5: Chapter4 Medium AcMedium Access Controlcess Control

5

Multiple Access Protocols

• ALOHA• Carrier Sense Multiple Access Protocols• Collision-Free Protocols• Limited-Contention Protocols• Wavelength Division Multiple Access Protocols• Wireless LAN Protocols

Page 6: Chapter4 Medium AcMedium Access Controlcess Control

6

Pure ALOHA

In pure ALOHA, frames are transmitted at completely arbitrary times.

The ALOHA system was used for ground-based radio broadcasting, but the basic idea is applicable to any system in which uncoordinated users are competing for the use of a single shared channel.

Basic idea: • Let users transmit whenever they have data to be sent. • A sender can always find out whether or not its frame was destroyed by listening to the channel

output (due to the feedback property of broadcasting). • If the frame was destroyed, the sender just waits a random amount of time and sends it again.

Systems in which multiple users share a common channel in a way that can lead to conflicts are known as contention systems.

Page 7: Chapter4 Medium AcMedium Access Controlcess Control

8

Slotted ALOHASlotted ALOHA system: • Time is divided up into discrete intervals, each interval corresponding to one frame. • A terminal is not permitted to send until the beginning of the next slot.

Slotted ALOHA peaks at G = 1, with S = 1/e 0.368, twice that of pure ALOHA. The main reason for poor channel utilization of ALOHA (pure or slotted) is that all stations can transmit at will, without paying attention to what the other stations are doing.

Page 8: Chapter4 Medium AcMedium Access Controlcess Control

9

Carrier Sense Multiple Access protocols Protocols in which stations listen for a carrier (i.e., a transmission)

and act accordingly are called carrier sense protocols.

1-persistent CSMA (Carrier Sense Multiple Access): 1. To send data, a station first listens to the channel to see if anyone else is

transmitting. 2. If so, the station waits (keeps sensing it) until the channel becomes idle.

Otherwise, it transmits a frame. 3. If a collision occurs, the station waits a random amount of time and

starts all over again.

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle.

Page 9: Chapter4 Medium AcMedium Access Controlcess Control

10

Collisions in CSMA How could collisions happen in CSMA ? Whenever more than one station detect an idle channel and their

transmission times overlap. Discussions:

1. What's the effect of signal propagation delay ? The longer the delay, the more the collisions, and the worse

the performance of the protocol.

2. How about zero propagation delay ? There still exist chances of collisions.

3. Is this protocol any better than ALOHA (both pure and slotted) ?

Yes, because both stations have the decency to desist from interfering with the third station's frame.

Page 10: Chapter4 Medium AcMedium Access Controlcess Control

13

CSMA with Collision DetectionPersistent and nonpersistent CSMA protocols improve ALOHA by ensuring

that no station begins to transmit when it senses the channel busy.

CSMA/CD (Carrier Sense Multiple Access with Collision Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected.

The conceptual model: • To send data, a station first listens to the channel to see if anyone else

is transmitting. • If so, the station waits until the end of the transmission (1-persistent)

or wait a random period of time and repeats the algorithm (non-persistent). Otherwise, it transmits a frame.

• If a collision occurs, the station will detect the collision, abort its transmission, waits a random amount of time, and starts all over again.

Page 11: Chapter4 Medium AcMedium Access Controlcess Control

14

CSMA/CD can be in one of three states: contention, transmission, or idle

• When two stations both begin transmitting at exactly the same time, how long will it take them to realize that there has been a collision ?

The minimum time to detect the collision is the time it takes the signal to propagate from one station to the other.

• How long could the transmitting station be sure it has seized the network ? ( or 2 ? where is time equal to the full cable propagation)

• It is worth noting that no MAC-sublayer protocol guarantees reliable delivery. Even in the absence of collisions, the receiver may not have copied the frame correctly due to various reasons (e.g., lack of buffer space or a missed interrupt).

Page 12: Chapter4 Medium AcMedium Access Controlcess Control

15

Collision-Free Protocols• Can we avoid collision all together, even during the

contention period ? Yes. But how ?

• One assumption: there are N stations, each with a unique address from 0 to N –1 ``wired'' into it.

Which station gets the channel after a successful transmission ?

A basic bit-map protocol: • Each contention period consists of exactly N slots, with one slot time

being at least 2. • If station i (0 i N -1) has a frame to send, it transmits 1 bit during

the ith slot; otherwise, it transmits 0 bit during the ith slot. • After all slots have passed by, stations begin transmitting in numerical

order. • After the last ready station has transmitted its frame, another N-bit

contention period is begun.

Page 13: Chapter4 Medium AcMedium Access Controlcess Control

16

The basic bit-map protocol

• Protocols like this in which the desire to transmit is broadcast before the actual transmission are called reservation protocols.

• Low load situation: the bit map repeats over and over.

Page 14: Chapter4 Medium AcMedium Access Controlcess Control

18

Limited-Contention ProtocolsTwo basic channel acquisition strategies studied: a) Contention methods. E.g., ALOHA, CSMA. b) Collision-free methods. E.g., basic bit map. Two performance measures: a) Delay at low load. Contention methods are preferable. b) Channel efficiency at high load. Collision-free methods are

preferable. Could we combine the best properties of both the contention and

collision-free protocols ? Yes. Such new protocols, called limited contention protocols,

use a contention method at low loads, but use a collision-free technique at high loads.

Page 15: Chapter4 Medium AcMedium Access Controlcess Control

19

Basic idea of Limited-Contention Protocols

• Stations are divided into groups. • Each group is allocated a slot for transmission. • Members of one group compete for one slot only.

How to assign stations to slots (groups) ? Special cases:

1. Each group with only one member (e.g., basic bit-map). Collision-free.

2. Each group with two stations. The probability that both will try to transmit during a slot is p**2, which for small p is negligible.

3. A single group containing all stations (i.e., slotted ALOHA). Zero delay at low load but very high collisions at high load.

What we need is a way to assign stations to slots dynamically, with many stations per slot when the load is low and few station per slot when the load is high.

Page 16: Chapter4 Medium AcMedium Access Controlcess Control

20

Adaptive Tree Walk Protocol

Each bit slot (group) is associated with a particular node in the tree, with the root node corresponding to slot 0 for all stations in one group.

• Starting from the root node: all stations are permitted to try to acquire the channel. • If a collision occurs, the search continues recursively with the left and right children of that

node. • If a bit slot goes idle or if there is exactly one station that transmits into it, the searching of

its node can stop.

The algorithm devised by US Army for testing soldiers for syphilis during WW II: 1. The Army took a blood sample from N soldiers. 2. A portion of each sample was poured into a single test tube. The mixed sample was then tested. 3. If no antibodies were found, all the solders in the group were declared healthy. 4. Otherwise, two new mixed samples were prepared, one for soldiers 1 through N/2 and one from

the rest. 5. The process was repeated recursively until the infected soldiers were determined.

The computer version of this algorithm organizes the stations in a binary tree, as illustrated below.

Page 17: Chapter4 Medium AcMedium Access Controlcess Control

22

Wireless LAN Protocols

Wireless LANs have different properties than conventional wired LANs and require special MAC sublayer protocols.

All radio transmitters have some fixed range, so not all stations are necessarily within range of one another.

a) A transmitting. C is unable to detect A’s transmission, so it may falsely conclude that it may transmit to B, resulting in collision. This is called the hidden station problem)

b) B transmitting. C is able to detect A’s transmission, so it may falsely conclude that it may not send to D, which is called the exposed station problem.

A system of computers (e.g., notebook PCs) that communicate by radio can be regarded as a wireless LAN.

Page 18: Chapter4 Medium AcMedium Access Controlcess Control

23

Wireless LAN Protocols (2)

The MACA (Multiple Access with Collision Avoidance) protocol. (a) A sending an RTS to B. (b) B responding with a CTS to A.

Page 19: Chapter4 Medium AcMedium Access Controlcess Control

24

Ethernet Cabling

The most common kinds of Ethernet cabling.

Three kinds of Ethernet cabling.

(a) 10Base5, (b) 10Base2, (c) 10Base-T.

Page 20: Chapter4 Medium AcMedium Access Controlcess Control

25

Cable topologies

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

Repeaters are used to connect multiple cables together. It receives, amplifies, and retransmits signals in both directions. Repeaters are physical layer devices. No two transceivers may be more than 2.5 km apart, and no path between any two transceivers may traverse more than four repeaters.

Page 21: Chapter4 Medium AcMedium Access Controlcess Control

26

Manchester Encoding

(a) Binary encoding, (b) Manchester encoding, (c) Differential Manchester encoding.

All Ethernet systems use Manchester encoding due to its simplicity. The high signal is volts and the low signal is volts, giving a DC value of 0 volts.

None of the Ethernet versions use straight binary encoding since it leads to ambiguities: it cannot tell the difference between an idle sender (0 volts) and a 0 bit (0 volts).

What is needed is a way for receivers to unambiguously determine the start, end, or middle of each bit without reference to an external clock.

Page 22: Chapter4 Medium AcMedium Access Controlcess Control

27

Collision detection can take as long as 2 Length: 0 (46) - 1500 bytes. To make it easier to distinguish valid frames from garbage, 802.3 states that valid frames must be at least 64 bytes.

Another more important reason for having a minimum length frame is to prevent a station from completing the transmission of a short frame before the first bit has even reached the far end of the cable, which it may collide with another frame, as illustrated below.

Page 23: Chapter4 Medium AcMedium Access Controlcess Control

28

The binary exponential backoff algorithmAfter a collision, the station waits for a random time and try again. How the

randomization is done ? Time is divided into discrete slots whose length is equal to the worst case round

trip propagation time (2). 1. After the first collision, each station waits either 0 or 1 slot time at random. 2. After the second collision, each station waits either 0, 1, 2, or 3 slot times at

random. 3. After i collisions, a random number between 0 and 2**i – 1 is chosen, and that

number of slots is skipped. 4. After 10 collisions have been reached, the randomization interval is frozen at

1023 slots. 5. After 16 collisions, the controller gives up and reports failure.

What happens if the randomization interval for all collisions is always 1023?Think about the average delay when only a few stations collide. What happens if the randomization interval for all collisions is always 2? Think about the time needed to resolve the collision when 100 stations try to

send at once. This might take years to resolve. The mean number of times per transmission is e 2.72.

Page 24: Chapter4 Medium AcMedium Access Controlcess Control

29

Data Link Layer Switching

• Bridges from 802.x to 802.y• Local Internetworking• Spanning Tree Bridges• Remote Bridges• Repeaters, Hubs, Bridges, Switches, Routers, Gateways• Virtual LANs

Page 25: Chapter4 Medium AcMedium Access Controlcess Control

30

Local Internetworking

A configuration with four LANs and two bridges.

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. This decision is made by looking up the destination address in a big (hash) table inside the bridge.

Multiple LANs connected by transparent bridges do not need any change on their hardware and software. Transparent bridges operate in promiscuous mode, accepting every frame transmitted on all the LANs to which it is attached.

Page 26: Chapter4 Medium AcMedium Access Controlcess Control

32

Remote Bridges

Remote bridges can be used to interconnect distant LANs.

Page 27: Chapter4 Medium AcMedium Access Controlcess Control

33

Repeaters, Hubs, Bridges, Switches, Routers and Gateways

(a) Which device is in which layer.

(b) Frames, packets, and headers.

Page 28: Chapter4 Medium AcMedium Access Controlcess Control

34

Hubs, Bridges, and Switches

(a) A hub. Different from repeater, hubs do not amplify the incoming signals and are designed to hold multiple line cards each with multiple inputs (one collision domain). Like repeater, hubs do not examine the 802 addresses or use them in any way.

(b) A bridge. A bridge has line cards (like a hub) for different network types and speeds. However, each line is its own collision domain, in contrast to a hub.

(c) A switch. A switch is similar to bridge in its routing on frame addresses, but is often used to connect individual computers (no collision).


Recommended