0% found this document useful (0 votes)
6 views15 pages

Week13 Lec1 DataLinkLayerFundamentals I

Uploaded by

Harshit Kapadia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views15 pages

Week13 Lec1 DataLinkLayerFundamentals I

Uploaded by

Harshit Kapadia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Week 13_Lec 1

Computer Networks
Data Link Lay-Fundamentals-I

1
Why Link layer protocols?
• Between the two hosts, datagrams travel over a series of
communication links,

2
Link layer: introduction
terminology: mobile network
 hosts, routers: nodes national or global ISP
 communication channels that connect
adjacent nodes along communication
path: links
• wired , wireless
• LANs
 layer-2 packet: frame, encapsulates
datagram
datacenter
network

link layer has responsibility of


transferring datagram from one node
enterprise
to physically adjacent node over a link network

Link Layer 3
Host link-layer implementation
 In each-and-every host : on-chip or in network interface
card (NIC)
 attaches into host’s system buses
 Combination of hardware, software, firmware
 Software components On Sending side implement: application
• Assembling link-layer addressing information transport
cpu memory
network
• Activating the controller hardware. link

host bus
(e.g., PCI)
 On the receiving side controller
link
• Responds to controller interrupts (e.g., due to the receipt of one or physical
physical
more frames)
• Handling error conditions
• Passing a datagram up to the network layer.
network interface
Interfaces communicating
application application
transport transport
cpu memory memory CPU
datagram network network
link link

linkh datagram controller controller


link
datagram
link
physical physical
physical physical

sending side: receiving side:


 encapsulates datagram in frame  looks for errors, reliable data
 adds error checking bits, reliable data transfer, flow control, etc.
transfer, flow control, etc.  extracts datagram, passes to upper
layer at receiving side
MAC addresses
▪ 32-bit IP address:
• network-layer address for interface
• used for layer 3 (network layer) forwarding
• e.g.: 128.119.40.136

▪ MAC (or LAN or physical or Ethernet) address:


• function: used “locally” to get frame from one interface to another physically-
connected interface (same subnet, in IP-addressing sense)
• 48-bit MAC address (for most LANs) burned in NIC ROM, also sometimes
software settable

• e.g.: 1A-2F-BB-76-09-AD
hexadecimal (base 16) notation
(each “numeral” represents 4 bits)
MAC addresses
each interface on LAN
▪ has unique 48-bit MAC address
▪ has a locally unique 32-bit IP address (as we’ve seen)

137.196.7.78
1A-2F-BB-76-09-AD

LAN
(wired or wireless)
137.196.7/24
71-65-F7-2B-08-53 58-23-D7-FA-20-B0
137.196.7.23 137.196.7.14

0C-C4-11-6F-E3-98
137.196.7.88
Multiple access links, protocols
two types of “links”:
 point-to-point
• point-to-point link between Ethernet switch, host
• PPP for dial-up access
 broadcast (shared wire or medium)
• old-school Ethernet
• 802.11 wireless LAN, 4G/5G

shared wire (e.g., shared radio: 4G/5G humans at a cocktail party


cabled Ethernet) shared radio: WiFi (shared air, acoustical)
Multiple access protocols
 single shared broadcast channel
 two or more simultaneous transmissions by nodes: interference
• collision if node receives two or more signals at the same time

multiple access protocol


 distributed algorithm that determines how nodes share channel, i.e., determine when node
can transmit
 communication about channel sharing must use channel itself!
• no out-of-band channel for coordination

Link Layer 9
MAC protocols: taxonomy
three broad classes:
 channel partitioning
• divide channel into smaller “pieces” (time
slots, frequency, code)
• allocate piece to node for exclusive use
 random access
• channel not divided, allow collisions
• “recover” from collisions
 “taking turns”
• nodes take turns, but nodes with more to
send can take longer turns

Link Layer 10
Random access protocols
 when node has packet to send
• transmit at full channel data rate R
• no a priori coordination among nodes
 two or more transmitting nodes:
“collision”

 random access protocol specifies:


• how to detect collisions
• how to recover from collisions (e.g., via delayed retransmissions)
 examples of random access MAC protocols:
• ALOHA, slotted ALOHA
• CSMA, CSMA/CD, CSMA/CA
Slotted ALOHA
operation:
t0 t0+1
 when node obtains fresh
assumptions: frame, transmits in next slot
 all frames same size • if no collision: node can send
 time divided into equal size new frame in next slot
slots (time to transmit 1 frame) • if collision: node retransmits
 nodes start to transmit only frame in each subsequent
slot beginning slot with probability p until
 nodes are synchronized success
 if 2 or more nodes transmit in
slot, all nodes detect collision
Link Layer 12
Slotted ALOHA
node 1 1 1 1 1

node 2 2 2 2 C: collision
S: success
node 3 3 3 3
E: empty
C E C S E C E S S

Pros: Cons:
 single active node can  collisions, wasting slots
continuously transmit at full rate  idle slots
of channel  nodes may be able to detect collision in
 highly decentralized: only slots in
less than time to transmit packet
nodes need to be in sync
 clock synchronization
 simple
Link Layer 13
Slotted ALOHA: efficiency
efficiency: long-run fraction of successful slots (many nodes, all with many frames
to send)
• suppose: N nodes with many frames to send, each transmits in slot with probability p
• prob that given node has success in a slot = p(1-p)N-1
• prob that any node has a success = Np(1-p)N-1
• max efficiency: find p* that maximizes Np(1-p)N-1
• for many nodes, take limit of Np*(1-p*)N-1 as N goes to infinity, gives:
max efficiency = 1/e = .37
• at best: channel used for useful transmissions 37% of time!

Link Layer 14
• Effective transmission 0.37R bps
• If R -100 Mbps, throughout is 37Mbps!!!
• Where the problem ?

15

You might also like