Notes
Notes
Notes
R-20 III-I IT
Computer Networks
Unit-3 Media/Medium Access Control Sublayer of Network Layer
1. In any broadcast network, the issue is how to determine who gets to use the channel
when there is competition for it.
Ex: Consider a conference call in which six people, are all connected so that each
one can hear and talk to all the others. It is very likely that when one of them stops
speaking, two or more will start talking at once, leading to chaos.
Many protocols for solving the problem exist and are studied in this chapter.
2. Channel Allocation Problem: The theme of this chapter is how to allocate a single
broadcast channel among competing users.
The channel connects each user to all other users; any user who uses the channel
interferes with other users who also wish to use the channel.
3. Static Channel Allocation: If there are N users, the bandwidth is divided into N
equal-sized portions, with each user being assigned one portion. Since each user
has a private frequency band, there is no interference among users. Ex: FM radios. If
the number of senders is very large, unexpected problems can surface; and if the no.
of users is less, bandwidth is wasted.
4. Dynamic Channel Allocation: It is important to know that there are five key
assumptions:
a. Independent Traffic: The model consists of N independent stations (e.g.,
computers, telephones), each with a user that generates frames for transmission.
Once a frame has been generated, the station is blocked and does nothing until
the frame has been successfully transmitted.
b. Single Channel: A single channel is available for all communication. All stations
can transmit on it and all can receive from it. The stations are assumed to be
equally capable.
e. Carrier Sense: With this assumption, stations can tell if the channel is busy
before trying to use it. If a channel is indeed busy, no station will use it.
No Carrier Sense: Stations cannot sense the channel before trying to use it.
They just go ahead and transmit.
5. ALOHA: Each user terminal shares the same upstream frequency to send frames to
the central computer. It is a simple and elegant method to solve the channel
allocation problem.
6. Pure ALOHA: The basic idea of an ALOHA system is to let users transmit whenever
they have data to be sent. In the ALOHA system, after each station has sent its
frame to the central computer, this computer rebroadcasts the frame to all of the
stations.
A sending station can thus listen for the broadcast from the hub to see if its frame
has been transmitted. If the frame was destroyed, the sender just waits a random
amount of time and sends it again. The waiting time must be random – if not, the
same frames will collide over and over, resulting a lockstep.
Whenever two frames try to occupy the channel at the same time, there will be a
collision and both will be corrupted. If the first bit of a new frame overlaps with just
3
the last bit of a frame that has almost finished, both frames will be totally destroyed
(i.e., have incorrect checksums) and have to be retransmitted later.
7. Efficiency of ALOHA Channel: This means what fraction of all transmitted frames
can escape collisions?
Initially, all users are in the typing state. When a line is finished, the user stops
typing, waiting for a response. The station then transmits a frame containing the line
over the shared channel to the central computer and checks the channel to see if it
was successful.
If so, the user sees the reply and goes back to typing. If not, the user continues to
wait while the station retransmits the frame over and over until it has been
successfully sent.
Let the ‘‘frame time’’ denote the amount of time needed to transmit a fixed-length
frame (i.e., the frame length divided by the bit rate).
Assume that the new frames generated by the stations are well modelled by a
Poisson distribution with a mean of N frames per frame time.
If N > 1, the user community is generating frames at a higher rate than the channel
can handle, and every frame will suffer a collision. For obtaining a reasonable
throughput, we can expect 0<N<1.
NOTE: Throughput denotes the amount of data moved successfully from one place
to another in a given time period.
8. A frame will not suffer a collision if no other frames are sent within one frame time of
its start.
Let t be the time required to send one frame. If any other user has generated a frame
between time t0 and t0 + t, the end of that frame will collide with the beginning of the
shaded one.
Similarly, any other frame started between t 0 + t and t0 + 2t will bump into the end of
the shaded frame.
4
The probability that k frames are generated during a given frame time, in which G
frames are expected, is given by the Poisson distribution
The relation between the offered traffic and the throughput is shown below.
9. Slotted ALOHA: In this method, a station is not permitted to send whenever the user
types a line. Instead, it is required to wait for the beginning of the next slot. Thus, the
continuous time ALOHA is turned into a discrete time one. This reduces the
vulnerable period by a half.
5
When Internet access came into existence, there was a problem of how to allocate a
shared channel among multiple competing users. Slotted ALOHA was identified as
the best method possible.
10. Carrier Sense Multiple Access (CSMA): Protocols in which stations listen for a
carrier (i.e., a transmission) and act accordingly are called carrier sense protocols.
11. Persistent CSMA: When a station has data to send, it first listens to the channel to
see if anyone else is transmitting at that moment. If the channel is idle, the stations
sends its data.
Otherwise, if the channel is busy, the station waits until it becomes idle to transmit a
frame. If a collision occurs, the station waits a random amount of time and starts
transmission again, from the start.
The protocol is called 1-persistent because the station transmits with a probability of
1 when it finds the channel idle.
NOTE: If two stations become ready in the middle of a third station’s transmission,
both will wait until the transmission ends, and then both will begin transmitting
simultaneously, resulting in a collision.
There is a chance that just after a station begins sending, another station will
become ready to send and sense the channel. If the first station’s signal has not yet
reached the second one, it will sense an idle channel and will also begin sending,
resulting in a collision.
This chance depends on the number of frames that fit on the channel, or the
bandwidth-delay product of the channel.
also idle, it either transmits or defers again, with probabilities p and q. This process is
repeated until either the frame has been transmitted or another station has begun
transmitting.
14. Figure 4-4 shows the computed throughput versus offered traffic for all three
protocols, as well as for pure and slotted ALOHA.
15. CSMA with Collision Detection: Persistent and non-persistent CSMA protocols are
an improvement over ALOHA because they ensure that no station transmits while
the channel is busy. However, if two stations sense the channel to be idle and begin
transmitting simultaneously, their signals can collide.
Another improvement is stations can quickly detect the collision and stop transmitting
to save time and bandwidth. This protocol, known as CSMA/CD (CSMA with
Collision Detection), is the basis of the Ethernet LAN.
NOTE: Collision detection is an analog process. The station’s hardware must listen
to the channel while it is transmitting. If the signal it reads is different from the signal
it is transmitting out, it understands that there was a collision.
CSMA/CD uses the conceptual model shown in the figure below.
At the point marked t0, station has finished transmitting its frame. Any other station
having a frame to send may now attempt to do so. If a station detects a collision, it
aborts its transmission, waits a random period of time, and then tries again.
The model for CSMA/CD will consist of alternating contention and transmission
periods, with idle periods occurring when all stations are quiet.
7
16. Contention Algorithm: Suppose that two stations both begin transmitting at exactly
time t0. How long will it take them to realize that they have collided? The answer is
vital to determine the length of the contention period and hence throughput.
The minimum time to detect the collision is the time taken by the signal to propagate
from one station to the other.
Let the time for a signal to propagate between the two farthest stations be T (Tau).
At t0, one station begins transmitting. At t0 + T – ε, an instant before the signal arrives
at the most distant station, that station also begins transmitting. It detects the
collision instantly and stops, but the noise caused by the collision does not get back
to the original station until time 2T – ε. Hence a station cannot be sure that it has
seized the channel until it has transmitted for 2T without hearing a collision.
The difference for CSMA/CD compared to slotted ALOHA is that slots in which only
one station transmits (i.e., in which the channel is seized) are followed by the rest of
a frame. This difference will greatly improve performance if the frame time is much
longer than the propagation time.
8
Advantages of CMSA/CA:
CMSA/CA prevents collision.
Due to acknowledgements, data is not lost unnecessarily.
It avoids wasteful transmission.
It is very much suited for wireless transmissions.
10
Disadvantages of CSMA/CA:
The algorithm calls for long waiting times.
It has high power consumption.
19. Controlled Access Protocols: The previous access protocols discussed (ALOHA,
CSMA, CSMA/CD, CSMA/CA) were random access protocols. In controlled access
protocols, only one station can transmit the data frames at a time, which leads us to
a collision-free transmission through the channel.
1) Reservation: A station must make a reservation first before transmitting any data
frames.
Ex: Bit-Map Protocol: Here, each contention period consists of exactly N slots. If
station 0 has a frame to send, it transmits a 1 bit during the slot 0. No other station
is allowed to transmit during this slot. Regardless of what station 0 does, station 1
gets the opportunity to transmit a 1 bit during slot 1, but only if it has a frame
queued.
In general, station j may announce that it has a frame to send by inserting a 1 bit
into slot j. After all N slots have passed by, each station has complete knowledge
of which stations wish to transmit. At that point, they begin transmitting frames in
numerical order.
Since everyone agrees on who goes next, there will never be any collisions. If a
station becomes ready just after its bit slot has passed by, it must remain silent
until every station has had a chance and the bit map has come around again.
Protocols like this in which the desire to transmit is broadcast before the
actual transmission are called reservation protocols because they reserve
channel ownership in advance and prevent collisions.
Analyzation: Measure the time in units of the contention bit slot, with data frames
consisting of d time units.
11
Consider low numbered stations like 0 or 1. If load is less, the bit map will be
repeated again and again, for lack of data frames. A station will have to wait N /2
slots for the current scan to finish and another full N slots for the following scan to
run to completion before it may begin transmitting.
The high numbered stations will only have to wait half a scan (N /2 bit slots)
before starting to transmit. High numbered stations rarely have to wait for the next
scan. Since low-numbered stations must wait on average 1.5N slots and high-
numbered stations must wait on average 0.5N slots, the mean for all stations is N
slots.
At high load, when all the stations have something to send all the time, the N bit
contention period is distributed over N frames, yielding an overhead of only 1
bit per frame, or an efficiency of d/(d + 1).
The mean delay for a frame is equal to the sum of the time it queues inside its
station, plus an additional (N − 1) d + N once it gets to the head of its internal
queue. This interval is how long it takes to wait for all other stations to have their
turn sending a frame and another bitmap.
2) Token Passing: Bit-map protocol lets every station to transmit a frame in a
predefined order.
Another way to accomplish the same thing is to pass a small message called a
token from one station to the next in the same predefined order. The token
represents permission to send. If a station that receives a token has a frame to be
transmitted, it can send that frame before it passes the token to the next station. If
no frame is queued, it simply passes the token.
In a token ring protocol, the topology of the network is used to define the order in
which stations transmit. The stations are connected one to the next in a single ring.
Passing the token to the next station consists of receiving the token from one
direction and transmitting it in the other direction.
12
Frames are also transmitted in the direction of the token. To stop the frame
circulating indefinitely, some station (sender or receiver) needs to remove it from the
ring.
NOTE: The token circulates around the ring indefinitely.
21. Channelization: Channelization is a method that allows multiple stations to access
the same channel at the same time. The available bandwidth is shared between
different stations in time, frequency, or through code.
22. FDMA: Frequency-division multiple access (FDMA) is a channel access method that
allows multiple users to send data through a single communication channel, such as
a coaxial cable or microwave beam. This is done by dividing the bandwidth of the
channel into separate frequency sub-channels and allocating each sub-channel to a
separate user.
The frequency bands of different stations are separated by small bands of unused
frequency. These are called guard bands that prevent station interferences.
It is used in satellite communication systems and telephone trunk lines (direct line
between two telephone switchboards that are a considerable distance apart).
23. TDMA: It is a channel access method that allows several users to share the same
frequency channel by dividing the signal into different time slots. This is known as
static TDMA.
The users transmit one after the other, rapidly, using their own time slots. This allows
multiple stations to share the same transmission medium (e.g. radio frequency
channel) while using only a part of its channel capacity.
24. CDMA: It is a channel access method in which, several transmitters can send
information simultaneously over a single communication channel. This allows several
users to share common bandwidth. Each transmitter is assigned a code for
identification.
13
25. CDMA is one of the transmission technologies for digital mobile phones. The
transmitter mixes the packets constituting a message into the digital signal stream in
an order determined by a pseudo-random number sequence from which the receiver
extracts the parts intended for itself. Each different random sequence corresponds to
a separate communication channel.
26. Classic Ethernet is used as a thick coaxial cable to connect PCs. Performance was
3 to 10 Mbps. To allow larger networks, multiple cables can be connected by
repeaters. A repeater is a physical layer device that receives, amplifies (i.e.,
14
27. Switched Ethernet: Ethernet soon began to evolve away from the single long cable
architecture of classic Ethernet. The problems associated with finding breaks or
loose connections drove it toward a different kind of wiring pattern, in which each
station has a dedicated cable running to a central hub. A hub simply connects all the
attached wires electrically, as if they were soldered together.
28. Fast Ethernet: The basic idea behind fast Ethernet was simple: keep all the old
frame formats, interfaces, and procedural rules, but reduce the bit time from 100
nsec to 10 nsec. Fast Ethernet is entirely based on twisted-pair wiring, uses hubs
and switches.
29. Gigabit Ethernet: Gigabit Ethernet (GbE) is a computer networking technology that
transmits Ethernet frames at a rate of one gigabit per second (Gbps). This is a
theoretical maximum data rate of 1,000 Mbps.
15
30. 10-Gigabit Ethernet: 10 Gbps is needed inside data centers and exchanges to
connect high-end routers, switches, and servers, as well as in high bandwidth
between offices in MAN based on Ethernet and fiber.