CN Unit-3 Notes
CN Unit-3 Notes
Introduction:
The medium access control (MAC) layer is the lower sublayer of the data link layer (layer 2) of the seven-
layer OSI model. The MAC sublayer provides addressing and channel access control mechanisms that make it
possible for several network nodes to communicate within a multiple access network that incorporates a shared
medium, e.g. an Ethernet network.
The data link layer is divided into two sub layers. The upper sub layer is responsible for data link control,
and the lower sub layer is responsible for resolving access to the shared media. If the channel is dedicated, we do
not need the lower sub layer. Figure 3.1 shows these two sub layers in the data link layer
.
Figure 3.1 Data link layer divided into two functionality-oriented sublayers
1
ALOHA
Aloha means "Hello". Aloha is a multiple access protocol at the datalink layer and proposes how
multiple terminals access the medium without interference or collisionThe Slotted Aloha protocol involves
dividing the time interval into discrete slots and each slot interval corresponds to the time period of one frame.
This method requires synchronization between the sending nodes to prevent collisions.
A shared communication system like ALOHA requires a method of handling collisions that occur when
two or more systems attempt to transmit on the channel at the same time. In the ALOHA system, a node transmits
whenever data is available to send. If another node transmits at the same time, a collision occurs, and the frames
that were transmitted are lost..
2
• In pure ALOHA, the stations transmit frames whenever they have data to send.
• When two or more stations transmit simultaneously, there is collision and the frames are destroyed.
• In pure ALOHA, whenever any station transmits a frame, it expects the acknowledgement from the receiver.
• If acknowledgement is not received within specified time, the station assumes that the frame (or
acknowledgement) has been destroyed.
• If the frame is destroyed because of collision the station waits for a random amount of time and sends it
again.This waiting time must be random otherwise same frames will collide again and again.
• Therefore pure ALOHA dictates that when time-out period passes, each station must wait for a random amount
of time before resending its frame. This randomness will help avoid more collisions.
• In fig there are four stations that.contended with one another for access to shared channel. All these stations are
transmitting frames. Some of these frames collide because multiple frames are in contention for the shared
channel. Only two frames, frame 1.1 and frame 2.2 survive. All other frames are destroyed.
• Whenever two frames try to occupy the channel at the same time, there will be a collision and both will be
damaged. If first bit of a new frame overlaps with just the last bit of a frame almost finished, both frames
will be totally destroyed and both will have to be retransmitted.
Explanation:
• Slotted ALOHA was invented to improve the efficiency of pure ALOHA as chances of collision in pure
ALOHA are very high.
• In slotted ALOHA, the time of the shared channel is divided into discrete intervals called slots.
• The stations can send a frame only at the beginning of the slot and only one frame is sent in each slot.
• In slotted ALOHA, if any station is not able to place the frame onto the channel at the beginning of the slot i.e. it
misses the time slot then the station has to wait until the beginning of the next time slot.
• In slotted ALOHA, there is still a possibility of collision if two stations try to send at the beginning of the same
time slot as shown in fig.
• Slotted ALOHA still has an edge over pure ALOHA as chances of collision are reduced to one-halfAdvantages of
ALOHA protocol:
• A node that has frames to be transmitted can transmit continuously at the full rate of channel if it is the
only node with frames.
• Simple to be implemented
• No master station is needed to control the medium
4
Carrier sense multiple access
Carrier Sensed Multiple Access (CSMA) : CSMA is a network access method used on shared network
topologies such as Ethernet to control access to the network. Devices attached to the network cable listen (carrier
sense) before transmitting. If the channel is in use, devices wait before transmitting. MA (Multiple Access)
indicates that many devices can connect to and share the same network. All devices have equal access to use the
network when it is clear.Even though devices attempt to sense whether the network is in use, there is a good
chance that two stations will attempt to access it at the same time.
The chances of collision still exist because of propagation delay. The frame transmitted by one station
takes some time to reach other stations. In the meantime, other stations may sense the channel to be idle and
transmit their frames. This results in the collision.
Even if propagation delay time is zero, collision will still occur. If two stations became .ready in the middle of
third station's transmission, both stations will wait until the transmission of first station ends and then both will
begin their transmission exactly simultaneously. This will also result in collision.
5
(ii) Non-persistent CSMA
• In this scheme, if a station wants to transmit a frame and it finds that the channel is busy (some other station is
transmitting) then it will wait for fixed interval of time.
• After this time, it again checks the status of the channel and if the channel is free it will transmit.
• A station that has a frame to send senses the channel.
• If the channel is idle, it sends immediately.
• If the channel is busy, it waits a random amount of time and then senses the channel again.
• In non-persistent CSMA the station does not continuously sense the channel for the purpose of capturing it when
it detects the end of previous transmission.
Advantage of non-persistent
• It reduces the chance of collision because the stations wait a random amount of time. It is unlikely that two or
more stations will wait for same amount of time and will retransmit at the same time.
Disadvantage of non-persistent
• It reduces the efficiency of network because the channel remains idle when there may be stations with frames to
send. This is due to the fact that the stations wait a random amount of time after the collision.
6
• This method is used when channel has time slots such that the time slot duration is equal to or greater than the
maximum propagation delay time.
• Whenever a station becomes ready to send, it senses the channel.
• If channel is busy, station waits until next slot.
• If channel is idle, it transmits with a probability p.
• With the probability > P the station then waits for the beginning of the next time slot even channel is idle.
• With the probability < P and channel is idle then station transmits the data.
• This process is repeated till either frame has been transmitted or another station has begun transmitting.
• In case of the transmission by another station, the station acts as though a collision has occurred and it waits a
random amount of time and starts again.
Advantage of p-persistent
• It reduces the chance of collision and improves the efficiency of the network.
It is basically a refinement/improvisation of CSMA where the user detects the occurrence of data
packet collision along with sensing for the availability of carrier in a multiple user network
channel. However, this algorithm detects collision but is not capable of reducing it.
Initially when a node wishes to transmit a data packet then it first senses the channel to check for two
conditions whether it is
1. Free
2. Busy
If the channel is already busy that means the transmission is taking place by any other node of the
network. So, that particular node will wait and go for sensing again after some time interval. However, if the
node finds the channel free then it will start transmitting the data packet over the channel.
Now next, once transmission has started then the respective node will monitor the channel to see if
collision has occurred. Here also we have two conditions:
7
1. Collision is not detected
2. Collision is detected
If no collision has been detected by the node, then it continues to transmit and at the same time will
regularly keep on checking for collision signal. If no collision signal reaches the node during the whole
transmission, then it will consider that the transmission has been successfully completed.
However, if the transmitting node, detects data collision, then it immediately stops transmitting any
further bits and notifies all the other nodes in the network regarding data collision by sending a jamming
signal to all the nodes. After this, the respective node is required to check whether it has reached the
maximum limit of transmission attempts or not. So, for this, the node will increment the attempt by 1 after
each time it detects collision and check whether it is less than 15 or not.
The maximum permissible attempts to transmit a packet after detecting collision for a node is 15. So, here
will be two more conditions:
8
In networking technologies that use CSMA/CA as their access method, stations announce their
intention to transmit before they actually transmit their data onto the network media.
• Before transmitting the data station set the back off time to zero.
• It uses some persistence strategy method to sense the channel.
• if channel is free then station waits for some time its know as Inter Frame Gap and waits some
random amount of time then it sends the data
• if acknowledgment is received then transmission is successful without any collisions
• otherwise increment back off time,if time is not exceeding the given limit then wait and then uses
some persistence strategy method to sense the channel.
• Otherwise, the transmission is aborted.
In the Controlled access technique, all stations need to consult with one another in order to find out which
station has the right to send the data. No station can send the data unless it has been authorized by the other
stations.
The protocols lies under the category of Controlled access are as follows:
1. Reservation
2. Polling
3. Token Passing
1. Reservation:
In this method, a station needs to make a reservation before sending the data.
• Time is mainly divided into intervals.
• Also, in each interval, a reservation frame precedes the data frame that is sent in that interval.
• Suppose if there are 'N' stations in the system in that case there are exactly 'N' reservation minislots
in the reservation frame; where each minislot belongs to a station.
• Whenever a station needs to send the data frame, then the station makes a reservation in its own
minislot.
• Then the stations that have made reservations can send their data after the reservation frame.
Example
Let us take an example of 5 stations and a 5-minislot reservation frame. In the first interval, the
station 2,3 and 5 have made the reservations. While in the second interval only station 2 has made the
reservations.
9
2. Polling
The polling method mainly works with those topologies where one device is designated as the
primary station and the other device is designated as the secondary station. All the exchange of data must be
made through the primary device even though the final destination is the secondary device.
The primary station which acts as controller ,periodically polls(asks) all other stations is simply
referred to as polling. The primary device is always an initiator of the session.
Poll Function
In case if primary devices want to receive the data, then it usually asks the secondary devices if they have
anything to send. This is commonly known as Poll Function.
• There is a poll function that is mainly used by the primary devices in order to solicit transmissions
from the secondary devices.
• When the primary device is ready to receive the data then it must ask(poll) each secondary device in
turn if it has anything to send.
• If the secondary device has data to transmit then it sends the data frame, otherwise, it sends
a negative acknowledgment (NAK).
• After that in case of the negative response, the primary then polls the next secondary, in the same
manner until it finds the one with the data to send. When the primary device received a positive
response that means (a data frame), then the primary devices reads the frame and then returns an
acknowledgment (ACK )frame,
Select Function
In case, if the primary device wants to send the data then it tells the secondary devices in order to get ready
to receive the data. This is commonly known as the Select function.
• Thus the select function is used by the primary device when it has something to send.
• We had already told you that the primary device always controls the link.
10
• Before sending the data frame, a select (SEL ) frame is created and transmitted by the primary
device, and one field of the SEL frame includes the address of the intended secondary.
• The primary device alerts the secondary devices for the upcoming transmission and after that wait for
an acknowledgment (ACK) of the secondary devices.
Advantages of Polling
1. The minimum and maximum access times and data rates on the channel are predictable and fixed.
2. There is the assignment of priority in order to ensure faster access from some secondary.
Drawbacks
There are some cons of the polling method and these are as follows:
3. Token Passing
In the token passing methods, all the stations are organized in the form of a logical ring ,it follows particular
order.
• Basically, a special bit pattern or a small message that circulates from one station to the next station
in some predefined order is commonly known as a token.
• Possessing the token mainly gives the station the right to access the channel and to send its data.
• When any station has some data to send, then it waits until it receives a token from other station.
After receiving the token, it holds it and then sends its data. When any station has no more data in
order to send then it releases the token and then passes the token to the next logical station in the ring.
• Also, the station cannot send the data until it receives the token again in the next round.
11
• In Token passing, when a station receives the token and has no data to send then it just passes the
token to the next station.
• The problem that occurs due to the Token passing technique is the duplication of tokens or loss of
tokens. The insertion of the new station, removal of a station, also needs to be tackled for correct and
reliable operation of the token passing technique.
Channelization Protocols
Channelization is basically a method that provides the multiple-access and in this, the available
bandwidth of the link is shared in time, frequency, or through the code in between the different stations.
Channelization Protocols are broadly classified as follows:
• FDMA(Frequency-Division Multiple Access)
• TDMA(Time-Division Multiple Access)
• CDMA(Code-Division Multiple Access)
12
• In order to prevent station interferences, the allocated bands are separated from one another with the
help of small guard bands so that collision never happens
Advantages of FDMA
• This technique is efficient when the traffic is uniformly constant.
• FDMA is simple algorithmically and the complexity is less.
Disadvantages of FDMA
• By using FDMA, the maximum flow rate per channel is fixed and small.
13
Time-Division Multiple access is another method to access the channel for shared medium networks.
• With the help of this technique, the stations share the bandwidth of the channel in time.
• A time slot is allocated to each station during which it can send the data.
• Data is transmitted by each station in the assigned time slot.
• When using the TDMA technique then each station needs to know the beginning of its slot and the
location of its slot.
• If the stations are spread over a large area, then there occur propagation delays; in order to
compensate this guard, times are used.
• CDMA technique differs from the FDMA because only one channel occupies the entire
bandwidth of the link.
• The CDMA technique differs from the TDMA because all the stations can send data
simultaneously as there is no timesharing.
• The CDMA technique simply means communication with different codes.
• In the CDMA technique, there is only one channel that carries all the transmission
simultaneously.
• CDMA is mainly based upon the coding theory; where each station is assigned a code, Code is a
sequence of numbers called chips.
• The data from the different stations can be transmitted simultaneously but using different code
languages.
Wired LAN’s
A local area network (LAN) is a computer network that is designed for a limited geographic area
such as a building or a campus. Although a LAN can be used as an isolated network to connect computers in
an organization for the sole purpose of sharing resources, most LANs today are also linked to a wide area
network (WAN) or the Internet. The LAN market has seen several technologies such as Ethernet, Token
Ring, Token Bus, FDDI, and ATM LAN. Some of these technologies survived for a while, but Ethernet is by
far the dominant
technology.
In 1985, the Computer Society of the IEEE started a project, called Project 802, to set standards to
enable intercommunication among equipment from a variety of manufacturers. Project 802 is a way of
specifying functions of the physical layer and the data link layer of major LAN protocols.
• If the least significant bit of the first byte in a destination address is 0, the address is unicast;
otherwise, it is multicast.
•
• The broadcast address is a special case of the multicast address; the recipients are the stations on the
LAN. A broadcast destination address is forty eight 1’s.
All standard implementations use digital signaling (baseband) at 10 Mbps. At the sender, data are converted
to a digital signal using the Manchester scheme; at the receiver, the received signal is interpreted as
Manchester and decoded into data.
16
Changes in standard ethernet:
The 10-Mbps Standard Ethernet has gone through several changes before moving to the higher data rates.
A layer 2 switch is an N-port bridge with additional sophistication that allows faster handling
of the packets. Evolution from a bridged Ethernet to a switched Ethernet was a big step that
opened the way to an even faster Ethernet
17
10Base-T is always full-duplex. The full-duplex mode increases the capacity of each domain from 10
to 20 Mbps. Instead of using one link between the station and the switch, the configuration uses two links:
one to transmit and one to receive. Each station or switch can send and receive independently without
worrying about collision. There is no longer a need for carrier sensing; there is no longer a need for collision
detection. The job of the MAC layer becomes much easier. The carrier sensing and collision detection
functionalities of the MAC sub-layer can be turned off.
IEEE created Fast Ethernet under the name 802.3u. Fast Ethernet is backward-compatible with Standard
Ethernet, but it can transmit data 10 times faster at a rate of 100 Mbps. The goals of Fast Ethernet can be
summarized as follows:
a. Upgrade the data rate to 100 Mbps.
b. Make it compatible with Standard Ethernet.
c. Keep the same 48-bit address.
d. Keep the same frame format.
e. Keep the same minimum and maximum frame lengths.
Topology
Fast Ethernet is designed to connect two or more stations together. If there are only two stations, they can be
connected point-to-point. Three or more stations need to be connected in a star topology with a hub or a
switch at the center.
Working:
18
Categories of Fast Ethernet:
Topology
Gigabit Ethernet is designed to connect two or more stations. If there are only two stations, they can
be connected point-to-point. Three or more stations need to be connected in a star topology with a hub or a
switch at the center. Another possible configuration is to connect several star topologies or let a star topology
be part of another
19
Categories of Gigabit Ethernet:
20
Ten-Gigabit Ethernet(IEEE 802.3ae)
The IEEE committee created Ten-Gigabit Ethernet and called it Standard 802.3ae. The goals of the Ten-
Gigabit Ethernet design can be summarized as follows:
a. Upgrade the data rate to 10 Gbps.
b. Make it compatible with Standard, Fast, and Gigabit Ethernet.
c. Use the same 48-bit address.
d. Use the same frame format.
e. S. Keep the same minimum and maximum frame lengths.
f. Allow the interconnection of existing LANs into a metropolitan area network (MAN)
or a wide area network (WAN).
g. Make Ethernet compatible with technologies such as Frame Relay and ATM.
Ten-Gigabit Ethernet operates only in full duplex mode which means there is no need for contention;
CSMA/CD is not used in Ten-Gigabit Ethernet.
21