0% found this document useful (0 votes)
60 views

Data Link Layer MAC New

The document discusses the MAC (Media Access Control) sublayer of the data link layer. The MAC sublayer is responsible for determining how nodes access and share a multi-access communication channel. It uses various channel access methods like ALOHA, CSMA, and CSMA/CD. The key channel access techniques discussed are Pure ALOHA, Slotted ALOHA, non-persistent CSMA, 1-persistent CSMA, p-persistent CSMA, and CSMA/CD. The document compares their throughput performance and how they handle channel access when the medium is busy or idle.

Uploaded by

Mohamed Mushrif
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views

Data Link Layer MAC New

The document discusses the MAC (Media Access Control) sublayer of the data link layer. The MAC sublayer is responsible for determining how nodes access and share a multi-access communication channel. It uses various channel access methods like ALOHA, CSMA, and CSMA/CD. The key channel access techniques discussed are Pure ALOHA, Slotted ALOHA, non-persistent CSMA, 1-persistent CSMA, p-persistent CSMA, and CSMA/CD. The document compares their throughput performance and how they handle channel access when the medium is busy or idle.

Uploaded by

Mohamed Mushrif
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

DATA LINK LAYER

MAC SUB LAYER


1
DATA LINK LAYER- SUB LAYERS
Data link layer divided into two functionality-oriented sub layers

Responsible for error


and flow control

Logical Link Control (LLC)

Media Access Control


MAC

Responsible framing
and MAC address
and Multiple Access 2
Control
MEDIA ACCESS CONTROL SUB LAYER

3
MAC LAYER
¢ Data link Layer Deals with transmitting bits from one end to
other end of a point-to-point Link

¢ But how we do this in broadcast networks (More than two


stations share a common communication link)

¢ Key issue is who is going to use the channel when there is a


competition for it

¢ The protocol which determine who is going to transmit next, on


multi access channel belong to a sub layer of the DLL

¢ It is called MAC layer

4
¢ It is the bottom part of DLL
MEDIUM SHEARING TECHNIQUE

5
RANDOM ACCESS TECHNIQUE: PURE
ALOHA
Pure ALOHA Protocol Description

¢ All frames from any station are of fixed length (L bits)

¢ Stations transmit at equal transmission time (all stations produce


frames with equal frame lengths).

¢ A station that has data can transmit at any time

¢ After transmitting a frame, the sender waits for an


acknowledgment for an amount of time (time out) equal to the
maximum round-trip propagation delay = 2* tprop(see next slide)

¢ If no ACK was received, sender assumes that the frame or ACK


has been destroyed and resends that frame after it waits for a
random amount of time

¢ If station fails to receive an ACK after repeated transmissions, it 6


gives up
MAXIMUM PROPAGATION DELAY

¢ Maximum propagation delay(tprop): time it takes for a bit of a frame


to travel between the two most widely separated stations.

The farthest
station

Station B
receives
the first
bit of the
frame at
time t=
tprop

7
RANDOM ACCESS TECHNIQUE: PURE
ALOHA
Procedure for ALOHA protocol

8
FRAMES IN A PURE ALOHA NETWORK

9
PURE ALOHA PROTOCOL

¢ If the frame transmission time is Tfr sec, then the vulnerable time
is = 2 Tfr sec.

¢ This means no station should send during the Tfr -sec before this
station starts transmission and no station should start sending
during the Tfr -sec period that the current station is sending. 10
PURE ALOHA PROTOCOL
• The throughput for pure ALOHA is S = G × e −2G .
• The maximum throughput Smax = 0.184 when G= (0.5).

Where
• Tfr= Average transmission time for a frame
• G= Average number of frames generated by the system
(all stations) during one frame transmission time(Tfr)
• Maximum throughput of pure aloha (Smax = 0.184 )
occurs at G=0.5 (which correspond to total arrival rate of
“one frame per vulnerable period”)
• Smax = 0.184 =>max pure aloha throughput =18% of
channel capacity
11
Note

The throughput ( S) for pure ALOHA is


S = G × e −2G .
The maximum throughput
Smax = 0.184 when G= (1/2).

12
SLOTTED ALOHA
¢ Pure ALOHA vulnerable time = 2 x Tfr because there is no rule that
defines when the station can send

¢ Slotted ALOHA was invented to improve the efficiency of pure


ALOHA

13
SLOTTED ALOHA
• Throughput for slotted ALOHA is S = G × e−G .
• The maximum throughput Smax = 0.368 when G = 1(which
correspond to total arrival rate of “one frame per vulnerable
period”)
• Slotted ALOHA vulnerable time = Tfr

14
Note

The throughput for slotted ALOHA is


S = G × e−G .
The maximum throughput
Smax = 0.368 when G = 1.

15
Efficiency of Aloha
S = throughput =(success rate)

0.4

0.3
Slotted Aloha
0.2

0.1
Pure Aloha

0.5 1.0 1.5 2.0


G = offered load rate= new frames+ retransmitted
= Total frames presented to the link per
the transmission time of a single frame

16
CARRIER SENSE MULTIPLE ACCESS (CSMA)
¢ To improve performance, we should avoid transmissions that
are definite to cause collisions

¢ Based on the fact that in LAN propagation time is very small

¢ If a frame was sent by a station, All stations knows


immediately, so they can wait before start sending

¢ A station with frames to be sent, should sense the medium for


the presence of another transmission (carrier) before it starts
its own transmission

¢ This can reduce the possibility of collision but it cannot


eliminate it.

¢ Collision can only happen when more than one station begin
transmitting within a short time (the propagation time
period) 17
CARRIER SENSE MULTIPLE ACCESS
(CSMA)

18
Carrier Sense Multiple Access (CSMA)

¢ Vulnerable time for CSMA is the maximum propagation


time

¢ The longer the propagation delay, the worse the


performance of the protocol because of the above case.

19
TYPES OF CSMA PROTOCOLS

Different CSMA protocols that determine:


§ What a station should do when the medium is idle?
§ What a station should do when the medium is busy?

1. Non-Persistent CSMA
2. 1-Persistent CSMA

3. p-Persistent CSMA

20
NONPERSISTENT CSMA
o A station with frames to be sent, should sense the medium
1. If medium is idle, transmit; otherwise, go to 2
2. If medium is busy, (back off) wait a random amount of time and
repeat 1
o Non-persistent Stations are deferential (respect others)
o Performance:
o Random delays reduces probability of collisions because two
stations with data to be transmitted will wait for different amount
of times.
o Bandwidth is wasted if waiting time (back off) is large because
medium will remain idle following end of transmission even if one
or more stations have frames to send

Random
Waiting times

Wasted time
21
1-PERSISTENT CSMA
n To avoid idle channel time, 1-persistent protocol used
n Station wishing to transmit listens to the medium:
1. If medium idle, transmit immediately;
2. If medium busy, continuously listen until medium becomes idle;
then transmit immediately with probability 1
§ Performance
§ 1-persistent stations are selfish
§ If two or more stations becomes ready at the same time, collision
guaranteed

22
P-PERSISTENT CSMA
n Time is divided to slots where each Time unit (slot) typically equals
maximum propagation delay
n Station wishing to transmit listens to the medium:
1. If medium idle,
§ transmit with probability (p), OR
§ wait one time unit (slot) with probability (1 – p), then repeat 1.
2. If medium busy, continuously listen until idle and repeat step 1
3. Performance
n Reduces the possibility of collisions like non persistent
n Reduces channel idle time like 1-persistent

23
FLOW DIAGRAM FOR THREE PERSISTENCE METHODS

24
CSMA/CD (COLLISION DETECTION)

§ CSMA (all previous methods) has an inefficiency:


§ If a collision has occurred, the channel is unstable

until colliding packets have been fully


transmitted

§ 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 reducing channel wastage .


25
HOW DOES A NODE DETECT COLLISION?

of its own
signal, it means collision occurred

26
CSMA/CD PROTOCOL

¢ Use one of the CSMA persistence algorithm


(non-persistent, 1-persistent, p-persistent) for
transmission
¢ 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 that they will discard the
transmitted frame
— After sending the jam signal, back off (wait) for a
random amount of time, then Transmit the frame
again
27
CSMA/CD
¢ Question: How long does it take to detect a collision?
¢ Answer: In the worst case, twice the maximum
propagation delay of the medium

28
Note: a = maximum propagation delay

What is x?
CSMA/CD

§ Restrictions of CSMA / CD:


§ Packet transmission time should be at least as long as the
time needed to detect a collision (2 * maximum propagation delay
+ jam sequence transmission time)

Packet transmission time > (2*Maximum propagation delay +


Jam sequence transmission time)

§ To ensure that packet transmit with out collision, a host must be


able to detect a collision before it finishes transmitting a packet

§ In other words, there is a minimum length packet for CSMA/CD


networks

29
SIMPLIFIED ALGORITHM OF CSMA/CD

30
DOES SWITCHED NETWORK NEED CSMA/CD?

31
ETHERNET PROTOCOL
ETHERNET PROTOCOL
ETHERNET FRAME

•Ethernet operates in the data link layer and the physical layer.
•Ethernet supports data bandwidths from 10Mbps through 100Gbps.
Ethernet Encapsulation
•Ethernet standards define both the Layer 2 protocols and the Layer 1
technologies.

• MAC constitutes the lower sublayer of the data link layer.


MAC Sublayer
• Responsible for Data encapsulation and Media access control.

• Ethernet has been evolving since its creation in 1973.


Ethernet Evolution • The Ethernet frame structure adds headers and trailers around the
Layer 3 PDU to encapsulate the message being sent.

•The minimum Ethernet frame size is 64 bytes and the maximum is 1518
bytes.
Ethernet Frame Fields •Frame smaller than the minimum or greater than the maximum are dropped.
•Dropped frames are likely to be the result of collisions or other unwanted
signals and are therefore considered invalid.
ETHERNET PROTOCOL
ETHERNET FRAME (CONT.)

FCS- Frame Check Sequence


ETHERNET PROTOCOL
ETHERNET MAC ADDRESSES

MAC Addresses •MAC address is 48-bit long and expressed as 12 hexadecimal


and Hexadecimal digits.

•IEEE requires a vendor to follow two simple rules:


MAC Addresses: •Must use that vendor's assigned OUI as the first three bytes.
Ethernet Identity •All MAC addresses with the same OUI must be assigned a
unique value in the last three bytes.

•The NIC compares the destination MAC address in the frame


Frame with the device’s physical MAC address stored in RAM.
Processing •If there is a match, the framed is passed up the OSI layers.
•If there is no match, the device discards the frame.

•MAC addresses can be represented with colons, dashes or dots


and are case-insensitive.
MAC Address •00-60-2F-3A-07-BC, 00:60:2F:3A:07:BC, 0060.2F3A.07BC and
Representations 00-60-2f-3a-07-bc are all valid representations of the same MAC
address.

OUI- Organizational Unique Identifier


ETHERNET PROTOCOL
ETHERNET MAC ADDRESSES (CONT.)

• Unique address used when a frame is sent from a


Unicast MAC single transmitting device to a single destination
device.
Address • The source MAC address must always be a unicast.

• Used to address all nodes in the segment.


Broadcast • The destination MAC address is the address of FF-
MAC Address FF-FF-FF-FF-FF in hexadecimal (48 ones in
binary).

Multicast • Used to address a group of nodes in the segment.


• The multicast MAC address is a special value that
MAC Address begins with 01-00-5E in hexadecimal.
ETHERNET FRAME
LAN SWITCHES
LAN SWITCHES
THE MAC ADDRESS TABLE

Switch •An Ethernet Switch is a Layer 2 device.


•It uses MAC addresses to make forwarding decisions.

Fundamentals •The MAC address table is sometimes referred to as a content


addressable memory (CAM) table.

Learning MAC •Switches dynamically build the CAM by monitoring source


MACs.

Addresses •Every frame that enters a switch is checked for new addresses.
•The frame is forwarded based on the CAM.

Filtering •Since the switch knows where to find a specific MAC address, it
can filter the frames to that port only.

Frames •Filtering is not done is the destination MAC is not present in


the CAM.
CAM TABLE

MAC addresses are shortened for demonstration purposes.


LAN SWITCHES SWITCH PORT SETTINGS

Duplex and Speed Settings

Full-duplex – Both ends of the


connection can send and
receive simultaneously.
Half-duplex – Only one end of the
connection can send at a time.
A common cause of performance
issues on Ethernet links is
when one port on the link
operates at half-duplex and
the other on full-duplex.
Auto-MDX

Detects the type of connection


required and configures the
interface accordingly.
Helps reducing configuration
errors.
ADDRESS RESOLUTION PROTOCOL
ADDRESS RESOLUTION PROTOCOL
MAC AND IP

The combination of
Layer 2 addresses Layer 3 addresses
MAC and IP
are used to move are used to move
facilitate the End-
the frame within the packets through
to-End
the local network remote networks.
communication.

Destination on Same Network Destination on Remote


• Physical address (MAC address) Network
is used for Ethernet NIC to
Ethernet NIC communications • Logical address (IP address) is
on the same network. used to send the packet from
the original source to the final
destination.
ADDRESS RESOLUTION PROTOCOL
ARP

Introduction to •ARP allows the source to request the MAC address of the destination.
•The request is based upon the layer 3 address of the destination
ARP (known by the source).

•Resolving IPv4 addresses to MAC addresses


ARP Functions •Maintaining a table of mappings
•ARP uses ARP Request and ARP Reply to perform its functions.

•Entries are removed from the device’s ARP table when its cache
Removing Entries timer expires.

from an ARP Table •Cache timers are OS dependent.


•ARP entries can be manually removed via commands.

•On IOS: show ip arp


ARP Tables •On Windows PCs: arp -a
ARP TABLE
ADDRESS RESOLUTION PROTOCOL
ARP ISSUES

ARP • ARP requests can flood the


Broadcasts local segment.

• Attackers can respond to


ARP requests and pretend to be
Spoofing providers of services.
Example: default gateway
ARP SPOOFING
CHAPTER SUMMARY
SUMMARY
§ Explain the operation of Ethernet.
§ Explain how a switch operates.
§ Explain how the address resolution protocol enables communication on a network.

You might also like