Week13 Lec1 DataLinkLayerFundamentals I
Week13 Lec1 DataLinkLayerFundamentals I
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 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
• 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
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”
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