Professional Documents
Culture Documents
Unit - 2 Data Link Layer
Unit - 2 Data Link Layer
Control
MAC
Responsible framing
and MAC address and
Multiple Access Control
Multiple Access
Problem: When two or more nodes transmit at the same time, their
frames will collide and the link bandwidth is wasted during collision
• ALOHA Protocols
• Was designed for wireless LAN and can be used for any shared medium
• 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
Channel utilization or efficiency or Throughput is the percentage of the transmitted frames that arrive
successfully (without collisions) or the percentage of the channel bandwidth that will be used for
transmitting frames without collisions
ALOHA Maximum channel utilization is 18% (i.e, if the system produces F frames/s, then 0.18 * F frames
will arrive successfully on average without the need of retransmission).
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
Figure 13.4 Procedure for ALOHA protocol
Critical time for pure ALOHA protocol
Tfr= Frame
Transmission time
0.4
0.3
Slotted Aloha
0.2
0.1
Pure Aloha
Disadvantage
If (M) nodes want to transmit, many collisions can occur and the rate
allocated for each node will not be on average R/M bps
This causes low channel utilization
Random Access – Carrier Sense Multiple Access (CSMA)
• To improve performance, avoid transmissions that are certain 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)
Random Access – Carrier Sense Multiple Access (CSMA)
1. Non-Persistent CSMA
2. 1-Persistent CSMA
3. p-Persistent CSMA
Nonpersistent CSMA
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, (backoff) wait a random amount of time and repeat 1
Non-persistent Stations are deferential (respect others)
Performance:
Random delays reduces probability of collisions because two stations with
data to be transmitted will wait for different amount of times.
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
Random Waiting
times
Wasted time
1-persistent CSMA
To avoid idle channel time, 1-persistent protocol used
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
P-persistent CSMA
Time is divided to slots where each Time unit (slot) typically equals maximum
propagation delay
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
Reduces the possibility of collisions like nonpersistent
Reduces channel idle time like 1-persistent
Flow diagram for three persistence methods
Persistent and Nonpersistent CSMA
Comparison of the channel utilization versus load for various random access
protocols.
CSMA/CD (Collision Detection)
CSMA (all previous methods) has an inefficiency:
If a collision has occurred, the channel is unstable until
collisions.
Sender stops transmission if collision has occurred
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 also to make sure
that the collision signal will stay until detected by the furthest
station
After sending the jam signal, backoff (wait) for a random amount
CSMA/CD
• Question: How long does it take to detect a collision?
• Answer: In the worst case, twice the maximum propagation delay
Note: a = maximum propagation delay
of the medium
CSMA/CD
N=0
Choose R between
0 & 2k - 1
K=10 K=N
Yes
No
No
N < 10 N==16
N=N+1
Yes
Abort
Link layer:
• 32-bit IP address:
network-layer address
datagram to destination used to get IP subnet
1A-2F-BB-76-09-AD
LAN
(wired or adapter
wireless)
71-65-F7-2B-08-53
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
LAN addresses (more)
137.196.7.78
LAN has ARP table
1A-2F-BB-76-09-AD IP/MAC address mappings for
137.196.7.23
137.196.7.14 some LAN nodes:
< IP address; MAC address; TTL>
LAN
71-65-F7-2B-08-53
TTL (Time To Live): time after
58-23-D7-FA-20-B0
which address mapping will be
0C-C4-11-6F-E3-98 forgotten (typically 20 min)
137.196.7.88
ARP protocol: same LAN
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
IP
Eth
Phy
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
IP IP
Eth Eth
Phy Phy
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
IP
Eth
Phy
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
Questions to be answered ?
• In broadcast networks, How the
channel is divided between competing
users?
• What protocols are used for
allocating a multiple access channel ?
MAC Sublayer
Technology Options
Ethernet
Fast Ethernet
Gigabit Ethernet
10 Gig Ethernet
WLAN
Media Access
Ethernet and Wi-Fi are both “multi-access” technologies
Broadcast medium, shared by many hosts
Simultaneous transmissions will result in collisions
Media Access Control (MAC) protocol required
Rules on how to share medium
The Data Link Layer is divided into two Part MAC Media
Access Control) Sublayer and LLC (Logic Link Control)
Sublayer
LAN Technologies
802.3 Ethernet
Carrier-sense multiple access with collision detection
(CSMA/CD).
CS = carrier sense
MA = multiple access
CD = collision detection
Base Ethernet standard is 10 Mbps.
100Mbps, 1Gbps, 10Gbps standards came later
LAN Technologies
Ethernet CSMA/CD
CSMA/CD (carrier sense multiple access with collision
detection) media access protocol is used.
Data is transmitted in the form of packets.
Sense channel prior to actual packet transmission.
Transmit packet only if channel is sensed idle; else,
defer the transmission until channel becomes idle.
After packet transmission is started, the node monitors
its own transmission to see if the packet has
experienced a collision.
If the packet is observed to be undergoing a collision,
the transmission is aborted and the packet is
retransmitted after a random interval of time using
Binary Exponential Backoff algorithm.
LAN Technologies
Ethernet Address
End nodes are identified by their Ethernet Addresses
(MAC Address or Hardware Address) which is a unique 6
Byte address.
MAC Address is represented in Hexa Decimal format e.g
00:05:5D:FE:10:0A
The first 3 bytes identify a vendor (also called prefix) and
the last 3 bytes are unique for every host or device
LAN Technologies
Length
LAN Technologies
Ethernet
10 Base 5 (Thicknet) (Bus Topology)
10 Base 2 (Thinnet) (Bus Topology)
10 Base T (UTP) (Star/Tree Topology)
10 Base FL (Fiber) (Star/Tree Topology)
LAN Technologies
Repeater
LAN Technologies
Hub
LAN Technologies
Ethernet
Physical Media :-
10 Base5 - Thick Co-axial Cable with Bus Topology
10 Base2 - Thin Co-axial Cable with Bus Topology
10 BaseT - UTP Cat 3/5 with Tree Topology
10 BaseFL - Multimode/Singlemode Fiber with Tree
Topology
Fast Ethernet
100 Mbps bandwidth
Uses same CSMA/CD media access protocol and packet
format as in Ethernet.
100BaseTX (UTP) and 100BaseFX (Fiber) standards
Physical media :-
100 BaseTX - UTP Cat 5e
100 BaseFX - Multimode / Singlemode Fiber
Full Duplex/Half Duplex operations.
LAN Technologies
Fast Ethernet
Provision for Auto-Negotiation of media speed:
10 Mbps or 100Mbps (popularly available for copper
media only).
Gigabit Ethernet
1 Gbps bandwidth.
Uses same CSMA/CD media access protocol as in Ethernet
and is backward compatible (10/100/100 modules are
available).
1000BaseT (UTP), 1000BaseSX (Multimode Fiber) and
1000BaseLX (Multimode/Singlemode Fiber) standards.
Maximum Segment Length
1000 Base T - 100m (Cat 5e/6)
1000 Base SX - 275 m (Multimode Fiber)
1000 Base LX - 512 m (Multimode Fiber)
1000 Base LX - 20 Km (Singlemode Fiber)
1000 Base LH - 80 Km (Singlemode Fiber)
LAN Technologies
10 Gig Ethernet
10 Gbps bandwidth.
Uses same CSMA/CD media access protocol as in
Ethernet.
Propositioned for Metro-Ethernet
Maximum Segment Length
1000 Base-T - Not available
10GBase-LR - 10 Km (Singlemode Fiber)
10GBase-ER - 40 Km (Singlemode Fiber)
Link layer:
Digital Camera
Computer
Scanner
Inkjet
Printer
Packet switching
Circuit Switching
• Circuit switching:
There is a dedicated communication path between two stations (end-to-
end)
The path is a connected sequence of links between network nodes. On
each physical link, a logical channel is dedicated to the connection.
• Communication via circuit switching has three phases:
Circuit establishment (link by link)
• Routing & resource allocation (FDM or TDM)
Data transfer
Circuit disconnect
• Deallocate the dedicated resources
• The switches must know how to find the route to the
destination and how to allocate bandwidth (channel) to
establish a connection.
Circuit Switching Properties
• Inefficiency
Channel capacity is dedicated for the whole duration of a connection
If no data, capacity is wasted
• Delay
Long initial delay: circuit establishment takes time
Low data delay: after the circuit establishment, information is
transmitted at a fixed data rate with no delay other than the
propagation delay. The delay at each node is negligible.
• Developed for voice traffic (public telephone network) but
can also applied to data traffic.
For voice connections, the resulting circuit will enjoy a high
percentage of utilization because most of the time one party or the
other is talking.
But how about data connections?
Public Circuit Switched Network
• Datagram approach
• Virtual circuit approach
Datagram
• Virtual circuits
Network can provide sequencing (packets arrive at the same order) and
error control (retransmission between two nodes).
Packets are forwarded more quickly
• Based on the virtual circuit identifier
• No routing decisions to make
Less reliable
• If a node fails, all virtual circuits that pass through that node fail.
• Datagram
No call setup phase
• Good for bursty data, such as Web applications
More flexible
• If a node fails, packets may find an alternate route
• Routing can be used to avoid congested parts of the network
Comparison of
communication
switching
techniques
Link layer:
• Bursty traffic
• Slow processor
Congestion Control vs Flow Control
5-34