MAC Sublayer & Channel Allocation
MAC Sublayer & Channel Allocation
The first three octets (in transmission order) identify the organization that issued the
identifier and are known as the Organizationally Unique Identifier (OUI).
Remaining 3 octets represent the address of the Network Interface Card.
1
Universally administered and locally administered addresses are distinguished by
setting the second-least-significant bit of the most significant byte of the address. This
bit is also referred to as the U/L bit, short for Universal/Local, which identifies how
the address is administered.
Ex: 06-00-00-00-00-00 the most significant byte is 06 (hex), the binary form
of which is 00000110, where the second-least-significant bit is 1. Therefore, it
is a locally administered address. Consequently, this bit is 0 in all OUIs.
If the least significant bit of the most significant octet of an address is set to 0 (zero),
the frame is meant to reach only one receiving NIC. This type of transmission is called
unicast.
A unicast frame is transmitted to all nodes within the collision domain, which
typically ends at the nearest network switch or router.
Only the node with the matching hardware MAC address will accept the frame;
network frames with non-matching MAC-addresses are ignored, unless the device is
in promiscuous mode.
Time Division Multiplexing: Each user is statically allocated every Nth time
slot. If a user does not use the allocated slot. The same holds if we split up the
networks physically.
2
1. Station Model. The model consists of N independent stations (e.g., computers,
telephones, or personal communicators), each with a program or user that
generates frames for transmission. Stations are sometimes called terminals.
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. As
far as the hardware is concerned, all stations are equivalent, although protocol
software may assign priorities to them.
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.
4. a. Continuous Time. Frame transmission can begin at any instant. There is no
master clock dividing time into discrete intervals.
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.
5. a. 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.
b. 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.
4.2.1 ALOHA
ALOHA, the earliest random access method, was developed at the University of
Hawaii in early 1970.
It was designed for a radio (wireless) LAN, but it can be used on any shared medium.
It is obvious that there are potential collisions in this arrangement.
The medium is shared between the stations. When a station sends data, another station
may attempt to do so at the same time. The data from the two stations collide and
become garbled.
There are two forms of ALOHA
1. Pure ALOHA
2. Slotted ALOHA
3
Pure ALOHA
The original ALOHA protocol is called pure ALOHA. This is a simple, but
elegant protocol.
The idea is that each station sends a frame whenever it has a frame to send.
Since there is only one channel to share, there is the possibility of collision
between frames from different stations.
A collision involves two or more stations.
4
Figure: Vulnerable Time of Pure ALOHA
o Let us assume that the stations send fixed-length frames with each
frame taking Tfr s to send.
o The Above figure gives the vulnerable time of the Station A, Station A
sends a frame at time t. Now imagine station B has already sent a frame
between t - Tfr and t. This leads to a collision between the frames from
station A and station B. The end of B's frame collides with the beginning
of A's frame.
o On the other hand, suppose that station C sends a frame between t and
t+Tfr. Here, there is a collision between frames from station A and station
C. The beginning of C's frame collides with the end of A's frame.
o The vulnerable time, during which a collision may occur in pure
ALOHA, is 2 times the frame transmission time.
Pure ALOHA vulnerable time = 2 x Tfr
Slotted ALOHA
Slotted ALOHA was invented to improve the efficiency of pure ALOHA.
In slotted ALOHA we divide the time into slots of Tfr s and force the station to
send only at the beginning of the time slot.
Because a station is allowed to send only at the beginning of the synchronized
time slot, if a station misses this moment, it must wait until the beginning of
the next time slot. This means that the station which started at the beginning of
this slot has already finished sending its frame.
There is still the possibility of collision if two stations try to send at the
beginning of the same time slot.
5
Figure: Slotted ALOHA
Vulnerable Time: The vulnerable time for slotted ALOHA is one-half that of
pure ALOHA.
Slotted ALOHA vulnerable time = Tfr
6
Figure: Flow Diagram for ALOHA
Throughput:
o The average number of successful transmissions for slotted ALOHA is
S = G x e-G.
o The maximum throughput Smax is 0.368, when G = 1. In other words,
if a frame is generated during one frame transmission time, then 36.8
percent of these frames reach their destination successfully. This result
can be expected because the vulnerable time is equal to the frame
transmission time.
o If a station generates only one frame in this vulnerable time (and no
other station generates a frame during this time), the frame will reach
its destination successfully.
The throughput for slotted ALOHA is S =: G x e-G.
The maximum throughput Smax == 0.368 when G=1.
To minimize the chance of collision and, therefore, increase the performance, the
CSMA method was developed.
The chance of collision can be reduced if a station senses the medium before trying to
use it.
Carrier sense multiple access (CSMA) requires that each station first listen to the
medium (or check the state of the medium) before sending. In other words, CSMA is
based on the principle "sense before transmit" or "listen before talk."
CSMA can reduce the possibility of collision, but it cannot eliminate it.
Stations are connected to a shared channel (usually a dedicated medium).
7
The possibility of collision still exists because of propagation delay; when a station
sends a frame, it still takes time (although very short) for the first bit to reach every
station and for every station to sense it.
In other words, a station may sense the medium and find it idle, only because the first
bit sent by another station has not yet been received.
At time t1station B senses the medium and finds it idle, so it sends a frame.
At time t2 (t2> t1) station C senses the medium and finds it idle because, at this time,
the first bits from station B have not reached station C. Station C also sends a frame.
The two signals collide and both frames are destroyed.
9
Figure: Flow diagram for Non Persistent CSMA
P-Persistent CSMA:
o The p-persistent method is used if the channel has time slots with a slot
duration equal to or greater than the maximum propagation time.
o The p-persistent approach combines the advantages of the other two
strategies.
o It reduces the chance of collision and improves efficiency.
o In this method, after the station finds the line idle it follows these steps:
1. With probability p, the station sends its frame.
2. With probability q = 1 - p, the station waits for the beginning of the
next time slot and checks the line again.
a. If the line is idle, it goes to step 1.
b. If the line is busy, it acts as though a collision has occurred
and uses the back-off procedure.
10
Figure: Flow Diagram for P-Persistent CSMA
12
The basic idea behind CSMA/CD is that a station needs to be able to receive while
transmitting to detect a collision. The signal from the second station needs to add a
significant amount of energy to the one created by the first station.
In a wired network, the received signal has almost the same energy as the sent signal
because either the length of the cable is short or there are repeaters that amplify the
energy between the sender and the receiver. This means that in a collision, the
detected energy almost doubles.
In a wireless network, much of the sent energy is lost in transmission. The received
signal has very little energy. Therefore, a collision may add only 5 to 10 percent
additional energy. This is not useful for effective collision detection.
Carrier sense multiple access with collision avoidance (CSMA/CA) was invented for
this network.
Collisions are avoided through the use of CSMA/CA's three strategies:
The Interframe Space, The Contention Window, and Acknowledgments
Interframe Space:
o Collisions are avoided by deferring transmission even if the channel is
found idle.
o When an idle channel is found, the station does not send immediately.
o It waits for a period of time called the interframe space or IFS.
o The IFS time allows the front of the transmitted signal by the distant
station to reach this station.
o If after the IFS time the channel is still idle, the station can send, but it
still needs to wait a time equal to the contention time.
o The IFS variable can also be used to prioritize stations or frame types.
For example, a station that is assigned a shorter IFS has a higher
priority.
The Contention Window:
o The contention window is an amount of time divided into slots.
o A station that is ready to send chooses a random number of slots as its
wait time. The number of slots in the window changes according to the
binary exponential back-off strategy. This means that it is set to one
slot the first time and then doubles each time the station cannot detect
an idle channel after the IFS time. This is very similar to the p-
persistent method except that a random outcome defines the number of
slots taken by the waiting station.
o The contention window is that the station needs to sense the channel
after each time slot.
o If the station finds the channel busy, it does not restart the process; it
just stops the timer and restarts it when the channel is sensed as idle.
This gives priority to the station with the longest waiting time.
Acknowledgements:
o The data may be corrupted during the transmission. The positive
acknowledgment and the time-out timer can help guarantee that the
receiver has received the frame.
13
Figure: The Interframe Space, The Contention Window, and
Acknowledgments
CSMA/CA was mostly intended for use in wireless networks.
4.3 ETHERNET:
Ethernet is IEEE 802.3 standard. This is a dominant LAN technology and cheaper.
Ethernet is used for Wired LANs.
14
Ethernet Frame Format:
Preamble: The first field of the 802.3 frame contains 7 bytes (56 bits) of
alternating 0s and 1s that alerts the receiving system to the coming frame and
enables it to synchronize its input timing. The preamble is actually added at the
physical layer and is not (formally) part of the frame.
Start frame delimiter (SFD): The second field (l byte: 10101011) signals the
beginning of the frame. The SFD warns the station or stations that this is the
last chance for synchronization. The last 2 bits is 11 and alerts the receiver that
the next field is the destination address.
Destination address (DA): The DA field is 6 bytes and contains the physical
address of the destination station or stations to receive the packet.
Source address (SA): The SA field is also 6 bytes and contains the physical
address of the sender of the packet.
Length or type: This field is defined as a type field or length field. The
original Ethernet used this field as the type field to define the upper-layer
protocol using the MAC frame. The IEEE standard used it as the length field to
define the number of bytes in the data field.
Data: This field carries data encapsulated from the upper-layer protocols. It is
a minimum of 46 and a maximum of 1500 bytes.
CRC: The last field contains error detection information, in this case a CRC-
32
Ethernet has gone through 4 generations.
Standard Ethernet:
15
10 Base 5: Thick Ethernet
16
o The second implementation is called 10Base2, thin Ethernet, or
Cheapernet.
o 10Base2 also uses a bus topology, but the cable is much thinner and
more flexible.
o The cable can be bent to pass very close to the stations. In this case, the
transceiver is normally part of the network interface card (NIC), which
is installed inside the station.
o This cable is less expensive than 10Base5. Installation is also simple.
17
o The stations are connected to a hub via two pairs of twisted cable.
o Two pairs of twisted cable create two paths (one for sending and one
for receiving) between the station and the hub.
o Any collision here happens in the hub.
o Compared to 10BaseS or 10Base2, we can see that the hub actually
replaces the coaxial cable as far as a collision is concerned.
o The maximum length of the twisted cable here is defined as 100 m, to
minimize the effect of attenuation in the twisted cable.
Manchester Encoding:
o All standard implementations use digital signaling (baseband) at 10
Mbps.
o At the sender, data are converted to a digital signal using the
Manchester scheme.
o at the receiver, the received signal is interpreted as Manchester and
decoded into data.
o Manchester encoding is self-synchronous, providing a transition at each
bit interval.
18
Figure: Encoding and Decoding in Standard Ethernet
100 Base-TX:
o 100 Base-TX uses two pairs of twisted-pair cable (either category 5
UTP or STP).For encoding 4B/5B block coding is used to provide bit
synchronization by preventing the occurrence of a long sequence of 0s
and 1s. This creates a data rate of 125 Mbps, which is fed into MLT-3
for encoding.
100 Base-FX:
19
o 100Base-FX uses two pairs of fiber-optic cables.
o Optical fiber can easily handle high bandwidth requirements by using
simple encoding schemes.
o The designers of 100Base-FX selected the NRZ-I encoding scheme for
this implementation. NRZ-I has a bit synchronization problem for long
sequences of 0s (or 1s, based on the encoding). To overcome this
problem, the designers used 4B/5B.
20
Gigabit Ethernet: IEEE 802.3z, 802.3ab
The Data rate is 1Gbps
1000Base-SX:
1000Base T:
21
10 Gigabit Ethernet: IEEE 802.3ae, 802.3ak, 802.3an
1. Upgrade the data rate to 10 Gbps.
2. Make it compatible with Standard, Fast, and Gigabit Ethernet.
3. Use the same 48-bit address.
4. Use the same frame format.
5. Keep the same minimum and maximum frame lengths.
6. Allow the interconnection of existing LANs into a metropolitan area
network (MAN) or a wide area network (WAN).
7. Make Ethernet compatible with technologies such as Frame Relay and ATM
22
Figure: BSS with AP and Without AP
Extended Service Set:
o An extended service set (ESS) is made up of two or more BSSs with
APs. In this case, the BSSs are connected through a distribution system,
which is usually a wired LAN.
o The distribution system connects the APs in the BSSs.
o IEEE 802.11 does not restrict the distribution system; it can be any
IEEE LAN such as an Ethernet.
o The extended service set uses two types of stations: mobile and
stationary.
o The mobile stations are normal stations inside a BSS.
o The stationary stations are AP stations that are part of a wired LAN.
o When BSSs are connected, the stations within reach of one another can
communicate without the use of an AP. Communication between two
stations in two different BSSs usually occurs via two APs.
o The idea is similar to communication in a cellular network if we
consider each BSS to be a cell and each AP to be a base station.
o A mobile station can belong to more than one BSS at the same time.
23
o Frame control (FC): The FC field is 2 bytes long and defines the type
of frame and some control information.
The Subfields of FC:
o Addresses: There are four address fields, each 6 bytes long. The
meaning of each address field depends on the value of the To DS and
From DS subfields.
o Sequence control: This field defines the sequence number of the frame
to be used in flow control.
o Frame body: This field, which can be between 0 and 2312 bytes,
contains information based on the type and the subtype defined in the
FC field.
o FCS: The FCS field is 4 bytes long and contains a CRC-32 error
detection sequence.
Frame Types
o A wireless LAN defined by IEEE 802.11 has three categories of
frames: management frames, control frames, and data frames.
24
o Management Frames: Management frames are used for the initial
communication between stations and access points.
o Control Frames: Control frames are used for accessing the channel and
acknowledging frames.
o Data Frames: Data frames are used for carrying data and control
information.
Hidden Station Problem:
Figure shows that the RTS message from B reaches A, but not
C.
Because both Band C are within the range of A, the CTS
message, which contains the duration of data transmission from
B to A reaches C.
Station C knows that some hidden station is using the channel
and refrains from transmitting until that duration is over.
Exposed Station Problem:
o In this problem a station refrains from using a channel when it is,
available.
o In Figure, station A is transmitting to station B.
o Station C has some data to send to station D, which can be sent without
interfering with the transmission from A to B.
o Station C is exposed to transmission from A; it hears what A is sending
and thus refrains from sending. In other words, C is too conservative
and wastes the capacity of the channel.
26
Figure: Exposed Station Problem
o Solution:
The handshaking messages RTS and CTS cannot help in this
case, despite what you might think.
Station C hears the RTS from A, but does not hear the CTS
from B. Station C, after hearing the RTS from A, can wait for a
time so that the CTS from B reaches A; it then sends an RTS to
D to show that it needs to communicate with D. Both stations B
and A may hear this RTS, but station A is in the sending state,
not the receiving state.
Station B, responds with a CTS. The problem is here. If station
A has started sending its data, station C cannot hear the CTS
from station D because of the collision; it cannot send its data to
D.
It remains exposed until A finishes sending its data.
27
The functions of the bridge are few and simple:
The bridge makes no modification to the content or format of the frames it
receives, nor does it encapsulate them with an additional header.
Each frame to be transferred is simply copied from one LAN and repeated with
exactly the same bit pattern on the other LAN. Because the two LANs use the
same LAN protocols, it is permissible to do this.
The bridge should contain enough buffer space to meet peak demands. Over a
short period of time, frames may arrive faster than they can be retransmitted.
The bridge must contain addressing and routing intelligence. At a minimum,
the bridge must know which addresses are on each network to know which
frames to pass. Further, there may be more than two LANs interconnected by a
number of bridges. In that case, a frame may have to be routed through several
bridges in its journey from source to destination.
A bridge may connect more than two LANs.
Filtering: A bridge has filtering capability. It can check the destination address of a
frame and decide if the frame should be forwarded or dropped. If the frame is to be
forwarded, the decision must specify the port. A bridge has a table that maps addresses
to ports.
The bridge is designed for use between local area networks (LANs) that use identical
protocols for the physical and link layers (e.g., all conforming to IEEE 802.3).
Because the devices all use the same protocols, the amount of processing required at
the bridge is minimal.
28
Figure: Bridge between two different LANS
Each bridge, following the normal rules for handling unknown destinations,
uses flooding, which in this example just means copying it to LAN 2.
Bridge 1 sees F2, a frame with an unknown destination, which it copies to LAN
1, generating F3 (not shown). Similarly, bridge 2 copies F1 to LAN 1
generating F4 (also not shown). Bridge 1 now forwards F4 and bridge 2 copies
F3. This cycle goes on forever.
Solution: Some potential connections between LANs are ignored in the
interest of constructing a fictitious loop-free topology.
29
Figure: Spanning Tree Bridges
To build the spanning tree, first the bridges have to choose one
bridge to be the root of the tree. 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. This tree is the spanning tree.
If a bridge or LAN fails, a new one is computed.
Remote Bridges:
A common use of bridges is to connect two (or more) distant LANs. For
example, a company might have plants in several cities, each with its own
LAN. Ideally, all the LANs should be interconnected, so the complete system
acts like one large LAN.
Remote Bridges can be used to create a wide area network (WAN) link
between LANs. Remote bridges, where the connecting link is slower than the
end networks, largely have been replaced with routers.
30
Figure: Remote Bridge
31