Docsity

Link Layer Services and MAC Protocols in Data Communication - Prof. Ala I. Al-Fuqaha, Study notes of Computer Systems Networking and Telecommunications

Partial preview of the text

Download Link Layer Services and MAC Protocols in Data Communication - Prof. Ala I. Al-Fuqaha and more Study notes Computer Systems Networking and Telecommunications in PDF only on Docsity!

Data Link Protocols

Link Layer Services^ „

Framing, link access:

encapsulate datagram into frame, adding header, trailer

channel access if shared medium

“MAC” addresses used in frame headers to identify source,dest

„

different from IP address!

„

Reliable delivery between adjacent nodes

we learned how to do this already (chapter 3)!

seldom used on low bit error link (fiber, some twisted pair)

wireless links: high error rates

„

Q: why both link-level and end-end reliability?

Medium Access Control(MAC) Protocols

MAC Protocols: a 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 sendcan take longer turns

Channel Partitioning MAC protocols: FDMA

FDMA: frequency division multiple access „

channel spectrum divided into frequency bands

„

each station assigned fixed frequency band

„

unused transmission time in frequency bands go idle

„

example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6 idle

„

TDM (Time Division Multiplexing): channel divided into N time slots, one peruser; inefficient with low duty cycle users and at light load.

„

FDM (Frequency Division Multiplexing): frequency subdivided.

time

frequency bands

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 MAC protocol specifies:

how to detect collisions

how to recover from collisions (e.g., via delayed retransmissions)

„

Examples of random access MAC protocols:

slotted ALOHA

ALOHA

CSMA, CSMA/CD, CSMA/CA

Ethernet CSMA/CD algorithm

  1. If adapter detects another

transmission whiletransmitting, aborts andsends jam signal

  1. After aborting, adapter

enters

exponential

backoff

: after the mth

collision, adapter chooses a K at random from {0,1,2,…,

m

-1}. Adapter

waits K

512 bit times and

returns to Step 2

  1. Adaptor receives datagram

from net layer & createsframe

  1. If adapter senses channel

idle, it starts to transmitframe. If it senses channelbusy, waits until channelidle and then transmits

  1. If adapter transmits entire

frame without detectinganother transmission, theadapter is done with frame!

MAC Addresses and ARP

32-bit IP address:

network-layer

address

used to get datagram to destination IP subnet

MAC (or LAN or physical or Ethernet)address:

used to get datagram from one interface toanother physically-connected interface (samenetwork)

48 bit MAC address (for most LANs) burned in the adapter ROM

LAN Address (more)

„

MAC address allocation administered by IEEE

„

manufacturer buys portion of MAC addressspace (to assure uniqueness)

„

Analogy:

(a) MAC address: like Social Security

Number

(b) IP address: like postal address

„

MAC flat address

portability

can move LAN card from one LAN to another

„

IP hierarchical address NOT portable

depends on IP subnet to which node is attached

ARP: Address Resolution Protocol

„

Each IP node (Host,Router) on LAN hasARP table

„

ARP Table: IP/MACaddress mappings forsome LAN nodes

< IP address; MAC address;

TTL>

TTL (Time To Live): time after whichaddress mapping willbe forgotten (typically20 min)

Question: how to determineMAC address of Bknowing B’s IP address?

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

58-23-D7-FA-20-B

0C-C4-11-6F-E3-

71-65-F7-2B-08-

LAN

237.196.7.

237.196.7.

237.196.7.

237.196.7.

Routing to another LAN walkthrough: send datagram from A to B via R

assume A know’s B IP address

„

Two ARP tables in router R, one for each IP network (LAN)

„

In routing table at source Host, find router 111.111.111.

„

A In ARP table at source, find MAC address E6-E9-00-17-BB-4B,etc

R
B

„

A creates datagram with source A, destination B

„

A uses ARP to get R’s MAC address for

111.111.111.

„

A creates link-layer frame with R's MAC address as dest, framecontains A-to-B IP datagram

„

A’s adapter sends frame

„

R’s adapter receives frame

„

R removes IP datagram from Ethernet frame, sees its destined to B

„

R uses ARP to get B’s MAC address

„

R creates frame containing A-to-B IP datagram sends to B

A
R
B

Link Layer MediumAccess Control (MAC)

Ethernet Frame Structure (more) „

Addresses: 6 bytes

if adapter receives frame with matching destination address, orwith broadcast address (eg ARP packet), it passes data in frameto net-layer protocol

otherwise, adapter discards frame

„

Type: indicates the higher layer protocol (mostly IP butothers may be supported such as Novell IPX andAppleTalk)

„

CRC: checked at receiver, if error is detected, the frameis simply dropped