The Medium Access
Sub Layer
Network Categories :
1) Point to point connections n/w
2) Broadcast channels
In any broadcast network, the key issue is how to determine who gets to use the
channel when there is competition for it.
When only a single channel is available, determining who should go next is much
harder.
Broadcast channels are sometimes referred to as multi-access channels or random
access channels.
The protocols used to determine who goes next on a multiaccess channel belong to a
sublayer of the data link layer called the MAC (Medium Access Control) sublayer.
The MAC sublayer is especially important in LANs, many of which use a multiaccess
channel as the basis for communication.
The Channel Allocation Problem :
1) Static Channel Allocation
2) Dynamic channel allocation
1. Static Channel Allocation :
The traditional way of allocating a single channel, among multiple competing users is
Frequency Division Multiplexing (FDM).
If there are N users, the bandwidth is divided into N equal-sized portions each user
being assigned one portion.
Since each user has a private frequency band, there is no interference between users.
When there is only a small and constant number of users, each of which has a heavy
(buffered) load of traffic (e.g., carriers' switching offices), FDM is a simple and efficient
allocation mechanism.
Problems here are as follows :
a. Less number of user can be supported (N users, if bandwidth is divided into N bands)
b. New users cannot be added later on
c. If the number of user increases, the per user bandwidth decreases.
d. If some users are idle then their allotted bandwidth will go wasted.
e. Overall performance of the system is poor.
2) Dynamic Channel Allocation :
Key assumptions for dynamic channel Allocation:
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.
b) Slotted Time. Time is divided into discrete intervals (slots). Frame transmissions
always begin at the start of a slot.
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.
Multiple Access Control Protocols :
1) ALOHA
2) CSMA
3) CSMA/CD
1. ALOHA
Two types or versions of ALOHA
i) Pure ALOHA
ii) Slotted ALOHA
Pure ALOHA :
The basic idea of an ALOHA system is simple: let users transmit whenever they have
data to be sent.
There will be collisions, of course, and the colliding frames will be damaged. However,
due to the feedback property of broadcasting, a sender can always find out whether its
frame was destroyed by listening to the channel, the same way other users do.
If the frame was destroyed, the sender just waits a random amount of time and sends
it again.
Random time is selected to avoided repetitive collisions
With a LAN, the feedback is immediate; with a satellite, there is a delay of 270 msec
before the sender knows if the transmission was successful.
Systems in which multiple users share a common channel in a way that can lead to
conflicts are widely known as contention systems.
Advantage of ALOHA protocols :
1) A node that has frames to be transmitted can transmit continuously.
2) Simple to be implemented.
Disadvantage :
3) Many collisions can occur if the number of stations is large.
4) This causes low channel utilization.
SLOTTED ALOHA :
Here, time is divided into discrete
intervals called slots.
Each slot can transmit one frame.
Each user can transmit the frame
at the beginning of slot only.
If two or more frames are transmitted
in same slot, they will collide and need
to be retransmitted.
2) CARRIER SENSE MULTIPLE ACCESS PROTOCOLS (CSMA) :
Protocols in which stations listen for a carrier and act accordingly are called
carrier sense protocols.
In carrier sense protocol, stations can check whether the channel is free or
busy.
If channel is free then it will transmit or if it is busy then station has to wait
for channel to become free.
In other words, CSMA is based on the principle "sense before transmit" or
"listen before talk.“
Types of CSMA Protocols
1. Non-Persistent CSMA
2. 1-Persistent CSMA
3. p-Persistent CSMA
1) Persistent CSMA
To avoid long time delays and idle channel time, 1-persistent protocol is used.
Station wishing to transmit listens to the medium
If medium idle, transmit immediately;
If medium busy, continuously listen until medium becomes idle; then transmit
immediately with probability 1.
Advantage:
Waiting time for stations is reduced.
Channel idle time is reduced.
Disadvantage:
If two or more stations become ready
at the same time, collision guaranteed.
Nonpersistent CSMA
Works as follows:
1. A station that wants to transmit frames should sense the medium first
2. If medium is idle, transmit;
3. If medium is busy, (backoff) wait a random amount of time and repeat 1
Disadvantage:
Long time delays.
Bandwidth is wasted if waiting time (backoff) is large
because medium will remain idle following end of
transmission even if one or more stations
have frames to send.
Advantage:
Reduced probability of collisions. Because two stations
with data to be transmitted will wait for
different amount of times.
P- persistent CSMA protocol
If the node senses that the carrier is busy, it wait until the channel becomes idle.
If the node senses that the carrier is idle:
The node selects a random number.
If random number < p, transmits the message in the next slot. else try again from the start…
In p-persistent CSMA, When 2 or more nodes are waiting for the current transmission to
end, they will only collide when 2 or more nodes pick a random number that is less than p.
Value of p must be set in such a way that it highly likely that exactly one node will pick a
random number that is less than p.
For example, if on the average, there are 2 nodes that are waiting for a transmission to
finish, then: set p = ½ = 0.5
On the other hand, if on the average, there are 3 nodes that are waiting for a transmission
to finish, then : set p = 1/3 = 0.3333
And so on…
p must be dynamic.
CSMA/CD (Collision Detection)
CSMA (all previous methods) has an inefficiency :
If a collision has occurred, the channel is unstable until all colliding packets have been
fully transmitted.
This cause wastage of bandwidth.
CSMA/CD (Carrier Sense Multiple Access with Collision Detection) overcomes this as follows:
While transmitting, the sender is listening to medium for collisions.
Sender stops transmission if collision has occurred.
Thus it reduces bandwidth wastage.
If a collision is detected by a station during its transmission then it should do the following:
Abort transmission and transmit a jam signal(48 bit) to notify other stations of collision
so they can also stop transmission.
After sending the jam signal, wait for a random amount of time, then transmit the frame
again.
Local Area Networks
Local area networks (LANs) connect computers within a building or a enterprise network
Almost all LANs are broadcast networks
Typical topologies of LANs are bus or ring or star
We will work with Ethernet LANs.
IEEE 802 Standards (Institute of Electrical and Electronics Engineers)
IEEE 802 is a family of standards for LANs.
Many designs for personal, local and metropolitan area networks are standardized as
IEEE 802.
LAN Standards: 802.1(classic) 802.2
802.3(Ethernet) 802.4
802.5
802.11(Wireless LAN)
IEEE 802.3 Ethernet LANs
Ethernet is a type of computer networking technologies for local area networks (LANs).
Ethernet was standardized as IEEE 802.3.
In 802.3, the MAC sub layer uses CSMA/CD (Carrier Sense Multiple Access with
Collision Detection) technology.
Frame format
Preamble Start of Destination Source Length Data Pad Checksum
Frames Address
7 1 2-6 2-6 2 0-1500 0-46 4
1) Preamble: It is used for synchronization purpose. It is of 7 bytes which contain 10101010
pattern.
2) Start of Frame.: 1 byte is used to indicate starting of frame contents it has 10101011 bit
pattern.
3) Destination address: 2-6 Bytes are reserved to specify destination address.
4) Source address: 2-6 Bytes are reserved for source address.
In Destination address, MSB is 0 for addressing single user, MSB is 1 for addressing
group of users.
Sending a data to a group of user is known as multicasting. If all bits are 1, it indicates
broadcasting.
Frame format
Preamble Start of Destination Source Length Data Pad Checksum
Frames Address
7 1 2-6 2-6 2 0-1500 0-46 4
5) length: 2 bytes are reserved for length field to specify total number of bytes included in the
frame.
6) data: 0 – 1500 bytes are reserved for data.
7) Checksum: 4 bytes are reserved for checksum which is used to defect the errors.
8) Pad: A pad field is used to make a valid frame of 64 bytes (minimum required size of a
frame).
It can be maximum of 46 bytes.
IEEE 802.3 Cabling Standards
- The following is a list of the commonly used cables in 802.3 LANs.
Cable Name Cable Type Transmission Rate Max. length before Max. No. of Advantage
repeater needed Computer
10Base5 Thick 10Mbps 500 metres 100 per Long cable
coaxial segment length
10Base2 Thin coaxial 10Mbps 200 metres 30 per Low cost
cable segment
10BaseT Twisted 10/100 Mbps 100 metres 1024 per Easy to
Pair segment maintain
10BaseF Fiber Optic 100/1000 2000 metres 1024 per No noise
cable Mbps segment interference
IEEE 802.3 Cabling Standards
– 10Base5
Connections are made using tap to a thick coaxial cable.
Bus topology is used.
This results in a poor connection between the computer and the coaxial cable.
– 10Base2
This was the most popular 802.3 cable because it was cheap and there was a good
connection between the computer and the coaxial cable.
– 10BaseT
Star topology is used.
Stations are connected to a hub via two pairs of twisted cable.
Currently most popular since it is easy to maintain but is more expensive.
– 10BaseF
Good for high speed connections between buildings.
802.3 Ethernet – Advantages
Widely used at present. People are experienced in using this technology.
Simple Protocol. New computers can be added without having to bring the network
down.
Almost zero delay at low load, there is no need to wait for a token, you can transmit when
ready.
802.3 Ethernet – Disadvantages
The electronics is more complicated for carrier sense and collision detection.
The smallest frame must hold 64 bytes, this means there is a substantial overhead if you
are only transmitting a single character from your machine.
Ethernet is non-deterministic system (possibility of repeated collisions). This means that
Ethernet is not suitable for network applications that require guaranteed delivery times.
Poor performance at high loads as there can be lots of collisions reducing the number of
messages that are successfully transmitted.
Manchester Encoding:
Manchester coding is used in IEEE802.3 standards. There are two types of Manchester
coding:
(1)Simple Manchester coding
A 0 is expressed by a low-to-high transition, a 1 by high-to-low transition
(2)Differential Manchester coding.
Keep the same sign until you get next ‘1’. Only bit ‘1’ can change the pattern. In Differential
Manchester encoding the first ‘1’ is represented by High to low pulse. Then it continues with
the same pulse until the next ‘1’ arrives. Next ‘1’ change the pulse to low to High value.
Token Bus (IEEE 802.4)
Here stations are logically connected as a ring but physically on a Bus and follows the
collision-free token passing medium access control protocol.
In CSMA/ CD delivery time is uncertain.
Token bus provides deterministic delivery time, which is necessary for real time traffic.
It is the technique in which the station on bus or tree forms a logical ring. The stations are
assigned positions in an ordered sequence, with the last number of the sequence followed
by the first one.
Each station knows the identity of the station following it and preceding it.
A control packet known as a Token regulates the right to access.
When a station receives the token, it is granted control to the media for a specified
time, during which it may transmit one or more packets and may poll stations and
receive responses when the station is done, or if its time has expired then it passes
token to next station in logical sequence.
Frame Format
Pre-amble
1 Byte is used as preamble, which is used for synchronization purpose.
Start Delimiter
1 Byte is used for indicating starting of frame.
FC [Frame Control]
1 Byte of FC indicates whether the frame is control frame or data frame.
Control frames can be used for functions like, addition or deletion of a station
from logical ring, claim token, etc.
Destination
2 – 6 Bytes are reserved for destination address.
Source
2 – 6 Bytes are reserved for source address.
Data
0 – 8182 Bytes are reserved for the actual data or content.
Checksum
4 Bytes are reserved for checksum which is used to detect the error.
End
1 Byte is used to indicate end of frame.
Token Ring (IEEE 802.5)
The network is a physical ring.
A simple 3 byte token circulates from station to station until it encounters a station with
data to send.
The station keeps the token, and sends a data frame.
Each intermediate station examines the frame and destination address, and passes on the
frame to the next subsequent node on the ring.
When a station encounters it’s own address as the destination address, it flags the frame as
‘received’ (by changing a few bits), and passes it on.
Eventually, when the frame reaches to the sender, the sender looks at the changed bits and
knows whether the frame was received or not (and whether to resend the frame again later).
The way the connection to the ring is organized is that if a station is off-line, then the data
just goes past that station without interruption.
The data only travels in one direction though, so if a ring breaks, data will have no way of
getting around the ring.
Ring management involves figuring out when a frame has been damaged and asking for the
source to retransmit the frame.
Token Ring Frame Format
Starting Access Frame Destination Source Data Check Ending Frame
Delimiter Control Control Address Address sum Delimiter Status
1 1 1 2-6 2-6 Unlimited 4 1 1
Starting Delimiter
The Starting Delimiter field indicates the arrival of a frame or token.
Access Control
The Access Control field contains the following bits:
Priority bit—Used to indicate the priority of the frame or token.
Reservation bit—Used to indicate the priority required for the next token to use the ring.
Token bit—Used to differentiate a token from a data or command frame.
Monitor bit—Used by the active monitor to determine whether a frame is circling in the
ring endlessly.
Frame Control
The Frame Control field indicates the frame type and frame control information.
Destination Address
The Destination Address field indicates the address of the device or devices for which the frame
is intended.
Source Address
The Source Address field identifies the station that sent the frame.
Data
The data field contains the data that is being sent to upper layers.
Check Sum
The Frame Check Sum value is checked by a receiving station to determine if errors occurred in
transmission.
Ending Delimiter
The Ending Delimiter field indicates the end of the frame or token.
Frame Status
The Frame Status field indicates to the transmitting station whether this frame has been copied
by the destination station.
Token Frame Fields
Start Delimiter Access Control Ending Delimiter
Token is a special frame of 3 bytes.
Token Frame contains three fields, each of which is 1 byte in length:
Start delimiter (1 byte): Alerts each station of the arrival of a token.
Access-control (1 byte): Contains access-control information like, Priority,
Reservation, a token bit (used to differentiate a token from a data/command frame), etc.
End delimiter (1 byte): Signals the end of the token.
Relative comparison of the three standards
A comparison of the three standards for different functions is shown in following Table.