4 Mac
4 Mac
12.1
Objectives
2
MAC Sublayer
What is MAC?
The protocols used to determine who goes next on a multiaccess channel belong to a MAC sublayer.
MAC is important in LAN, which uses a multiaccess channel as the basis for communication.
3
Channel Allocation Problem
users:
In this chapter, we focused on dynamic techniques since they are the most
1. Independent traffic
2. Single channel
3. Observable Collisions
4. Continuous or slotted time
5. Carrier sense or no carrier sense
6
Channel and Traffic
A single channel is available for all communications.
All stations can transmit on it and all can receive from it.
7
Observable Collisions
8
Continuous or slotted time
Time may be assumed continuous, in which case frame transmission can begin
at any instant.
Alternatively, time may be slotted or divided into discrete intervals (called slots).
Frame transmissions must then 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.
9
Carrier sense or no carrier sense
With the carrier sense assumption, stations can tell if the channel is in
use before trying to use it.
No station will attempt to use the channel while it is sensed as busy.
If there is 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 the transmission was successful.
10
Figure 12.2 Taxonomy of multiple-access protocols discussed in this chapter
12.11
12-1 RANDOM ACCESS
Protocols:
• ALOHA
• Carrier Sense Multiple Access
• Carrier Sense Multiple Access with Collision Detection
• Carrier Sense Multiple Access with Collision Avoidance
12.12
ALOHA
When a station sends data, another may attempt at the same time.
The data from the two stations collide and become garbled.
Pure ALOHA
Slotted ALOHA
12.13
Figure 12.3 Frames in a pure ALOHA network
12.14
Multiple Access Protocols: Pure ALOHA
15
Figure 12.4 Procedure for pure ALOHA protocol
12.16
Example 12.1
3 8
Tp = (600 × 10 ) / (3 × 10 ) = 2 ms.
a. For K = 1, the range is {0, 1}. The station needs to generate a random number with a value of 0
random variable.
12.17
Example 12.1 (continued)
b. For K = 2, the range is {0, 1, 2, 3}. This means that TB can be 0, 2, 4, or 6 ms, based on the
c. For K = 3, the range is {0, 1, 2, 3, 4, 5, 6, 7}. This means that TB can be 0, 2, 4, 8, 10, 12, or 14
12.18
Figure 12.5 Vulnerable time for pure ALOHA protocol
12.19
Example 12.2
A pure ALOHA network transmits 200-bit frames on a shared channel of 200 kbps. What is
Solution
Recall that:
This means a collision would happen if another station sends within 1ms before
this station starts transmission, or another station starts sending during the one 1-
one frameThetransmission
throughput for pure time.
ALOHA is
−2G
S=G×e .
when G= (1/2):
(−2*0.5)
The maximum throughput = 0.5 * e
This tells us that about 18.5% of the sent frame will survive (get to destination correctly)
A pure ALOHA network transmits 200-bit frames on a shared channel of 200 kbps.
12.22
Example 12.3 (continued)
Solution
• This means that the throughput is 1000 × 0.135 = 135 frames per second.
• Only 135 frames out of 1000 will probably survive.
12.23
Example 12.3 (continued)
b. If the system creates 500 frames per second, this is (1/2) frame per millisecond. The
12.24
Example 12.3 (continued)
12.25
Slotted ALOHA
• Slotted ALOHA was invented to improve the efficiency of pure ALOHA.
26
Figure 12.6 Frames in a slotted ALOHA network
Here, We divide the time into slots of Tfr seconds and force the
12.27
As a result:
Smax = 0.368
12.28
Figure 12.7 Vulnerable time for slotted ALOHA protocol
12.29
Example 12.4
A slotted ALOHA network transmits 200-bit frames on a shared channel of 200 kbps.
12.30
Example 12.4 (continued)
Solution
a. If the system creates 1000 frames per second, this is 1 frame per millisecond.
−G
S = G× e or S = 0.368 (36.8 percent).
This means that the throughput is 1000 × 0.368 = 368 frames. Only 386 frames
12.31
Example 12.4 (continued)
b. If the system creates 500 frames per second, this is (1/2) frame per millisecond.
−G
S=G×e or S = 0.303 (30.3 percent)
12.32
Example 12.4 (continued)
c. If the system creates 250 frames per second, this is (1/4) frame per millisecond.
−G
S=G×e or S = 0.195 (19.5 percent)
12.33
Limitations of Slotted ALOHA
34
Carrier Sense Multiple Access (CSMA) Protocols
- 1-persistent CSMA
- Non-persistent CSMA
- P-persistent CSMA
35
Figure 12.10 Behavior of three persistence methods
12.36
Figure 12.10 Behavior of three persistence methods
a station transmits if the channel is idle with a probability p (it waits until
random time).
12.37
Figure 12.11 Flow diagram for three persistence methods
12.38
Main advantages over ALOHA
12.39
1-persistent CSMA
• When station has data to send, it listens to channel.
• Channel busy: station waits till channel is idle
• Channel idle: station transmits frame
• Collision: Station waits random time and transmits frame again
40
1-persistent CSMA - Propagation delay
If a station is sending and its signal has not yet reached the
leading to a collision.
41
Non-persistent CSMA
1. Before sending, a station senses channel.
2. If no transmission, station starts sending.
3. However, if busy, it does not continuously sense the channel
to start transmitting
4. Instead, it waits random period before repeating.
42
CSMA with Collision Detection (CSMA/CD)
44
CSMA with Collision Detection (CSMA/CD)
45
CSMA with Collision Detection (CSMA/CD)
46
CSMA with Collision Detection (CSMA/CD)
47
Minimum Frame Size of CSMA/CD
The frame transmission time Tfr must be at least two times the maximum
- If the two stations involved in a collision are the maximum distance apart:
- The signal from the first takes time Tp to reach the second, and
- So, the requirement is that the first station must still be transmitting after
2Tp
48
Example 12.5
propagation time (including the delays in the devices and ignoring the time
needed to send a jamming signal, as we will see later) is 25.6 μs, what is the
49
Example 12.5
Solution
Tfr = 2 × Tp = 51.2 μs
• This means, in the worst case, a station needs to transmit for a
the frame).
• The minimum size of the frame is
• 10 Mbps × 51.2 μs = 512 bits or 64 bytes
• This is actually the minimum size of the frame for Standard
Ethernet
50
Figure 12.14 Flow diagram for the CSMA/CD
51
Energy level
52
Figure 12.15 Energy level during transmission, idleness, or collision
53
CSMA with Collision Avoidance (CSMA/CA)
Wireless networks.
Acknowledgments (ACK).
54
Figure 12.16 Timing in CSMA/CA
55
Note
station or a frame.
56
Note
In CSMA/CA, if the station finds the channel busy, it does not restart
it stops the timer and restarts it when the channel becomes idle.
57
Figure 12.17 Flow diagram for CSMA/CA
58
The Channel Allocation Problem
59
Dynamic vs Static Channel Allocation
60
Example of Static Channel Allocation: FDM
For example: if we have N users, the bandwidth will be divided into N equal-size
portions.
- - Waste of resources when the traffic is bursty or the channel is lightly loaded.
61
Example: FDM vs. TDM
62
Objectives
63
Data Link Layer Switching
CONNECTING DEVICES
1. Uses of Hubs
2. Learning Switches
3. Spanning Tree Switches.
4. Routers
Virtual LANs
64
CONNECTING DEVICES*
•
*Chapter 17 Connecting Devices and Virtual LANs (Forouzan et al.)
65
Figure 17.1: Three categories of connecting devices
Today, connecting devices can operate in different layers of the Internet model:
Hubs: operate in the first layer of the Internet model.
66
Link-layer switches: operate in the first two layers.
Repeaters, Hubs, Bridges, Switches, Routers,
and Gateways
69
Hubs
70
Hubs
71
Hubs
• When a packet from station A to station B arrives at the hub
• the signal is regenerated to remove any possible corrupting noise
• the hub forwards the packet to all outgoing ports except the sender port
• (broadcast: all stations gets it, but only station B keeps it)
Figure 17.2
72
Link-Layer Switch
73
Link-Layer Switch
Figure 17.3
74
Link-Layer Switch
• A better solution:
• a dynamic table that maps addresses to ports automatically
75
Figure 17.4: Learning switch
Gradual building of table
• Example:
• A sends a frame to station D, forwarded on all three ports (floods the
network)
• However, by looking at the source address, the switch learns that station
• If a switch fails, another switch takes over until the failed one is repaired or replaced
77
Loop problem in a learning switch (Part a)
Figure 17.5
78
Loop problem in a learning switch (Part b)
Figure 17.5
79
Loop problem in a learning switch (Part c)
Figure 17.5
80
Figure 17.5: Loop problem in a learning switch (Part d)
Figure 17.5
81
Spanning Tree Algorithm
• In a switched LAN
• this means creating a topology in which each LAN can be reached from any
other LAN through one path only (no loop)
82
A system of connected LANs and its graph (Part a)
83
A system of connected LANs and its graph (Part b)
• both LANs and switches
shown as nodes.
• The connecting arcs show
the connection of a LAN
to a switch and vice versa.
• To find the spanning tree, a. Actual physical system
84
Figure 17.7: Finding the shortest path and the spanning tree for a
switch.
1. Every switch has a built-in ID (normally the serial number, which is unique). Each switch broadcasts this ID so that all
switches know which one has the smallest ID. The switch with the smallest ID is selected as the root switch (root of the
2. The algorithm tries to find the shortest path (a path with the shortest cost) from the root switch to every other switch or
LAN. The shortest path can be found by examining the total cost from the root switch to the destination.
4. We mark the ports that are part of spanning tree, and the ports that are not part of it, the blocking ports, which block
86
the frames received by the switch.
Routers
87
Routers
88
Figure 17.9: Routing example
in each LAN. The two LANs can be connected to form a larger LAN using
The figure shows a switched LAN in an engineering firm in which nine stations are
• what would happen if the administrators needed to move engineers from their groups?
• In a switched LAN, changes in the work group mean physical changes in the network configuration. But,,,
VIRTUAL LANS
VLAN technology allows dividing a LAN into logical segments on top of the physical
VLAN technology even allows the grouping of stations connected to different switches in a VLAN.
Membership
ways:
• In a multi-switched backbone,
• each switch must know:
• which station belongs to which VLAN
17.101
Communication between Switches
• For example, in Figure 17.12, switch A must know the
membership status of stations connected to switch B, and
switch B must know the same about switch A.
17.102
Communication between Switches
• Security
References
Tanenbaum, Andrew S. (2011), Computer Networks. 5 th ed. New York, Pearson.
Forouzan, Behrous A. (2012), Data communications and Networking. 5 th ed. New York, McGraw-Hill Inc.
106