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

CS3201 Ch6

Uploaded by

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

CS3201 Ch6

Uploaded by

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

Link layer, LANs: roadmap

▪ introduction
Chapter 6
▪ multiple access protocols
▪ error detection and correction
▪ LANs
• addressing, ARP, RARP
• Ethernet
• switches
▪ data center networking
▪ a day in the life of a web request

Link Layer: 6-2


Link layer: introduction
terminology: mobile network
▪ hosts, routers, switches, etc.: nodes national or global ISP
▪ communication channels that
connect adjacent nodes along
communication path: links
• wired (cable, optical fiber)
• wireless
• LANs
▪ layer-2 “packet” (protocol data unit
or PDU): frame, encapsulates
datagram (packet) datacenter
network

link layer has the responsibility of reliably


transferring datagrams from one node enterprise
network
to a physically adjacent node over a link
Link Layer: 6-3
Link layer: context
▪ datagram transferred by transportation analogy:
different link protocols over ▪ you plan a trip from CityU (HK) to Disney
different links: (USA)
• e.g., home network: Wi-Fi on ▪ A friend suggests the following way:
first link, Ethernet on next link • taxi: CityU to HKG
• plane: HKG to SFO →MCO (Orlando)
▪ each link protocol provides • At MCO, you ask for direction
different services to Taxi stop.
• e.g., may or may not provide • Taxi: MCO to Disney
“reliable” data transfer over link ▪ you = datagram
▪ transport segment = communication link
▪ asking for direction = forwarding
▪ friend = routing algorithm
▪ transportation mode = link-layer Link
protocol
Layer: 6-4
Link layer: possible services
▪ framing, link access: …
• encapsulate datagram into frame, adding …
header and trailer (control fields)
• channel access if shared medium
• “MAC” addresses in frame headers identify
source, destination (different from IP
address!)
▪ reliable delivery between adjacent nodes
• guarantees to move each datagram across
link “without error” (“reliably”)
• seldomly used on low bit-error links
• wireless links: high error rates
• Q: why both link-level and end-end
reliability?
Link Layer: 6-5
Link layer: services (reliability)
▪ error detection: …
• errors caused by signal attenuation, noise. …
• receiver needs to detect errors and handle
signal retransmissions, or frame losses
▪ error correction:
• receiver identifies and corrects bit error(s)
without retransmissions

Link Layer: 6-6


Where is the link layer implemented?
▪ in each-and-every node
▪ link layer implemented in
network interface card (NIC) or application
chip transport
network cpu memory

• Ethernet, WiFi card or chip


link

host bus
• implements link, physical layer controller
(e.g., PCI)
link

▪ attaches to host’s system buses physical


physical

▪ combination of hardware & network interface


software
Link Layer: 6-7
Interfaces communicating
application application
transport transport
cpu memory memory CPU
datagram network network
link link

linkh datagram controller controller datagram


link link
physical physical
physical physical

sending side: receiving side:


▪ encapsulates datagram in frame ▪ detects errors, reliable data
▪ adds error checking bits, reliable data transfer, flow control, etc.
transfer, flow control, etc. ▪ extracts datagram, if no error,
passes to upper layer at receiving
side Link Layer: 6-8
Link layer, LANs: roadmap
▪ introduction
Chapter 6
▪ multiple access protocols
▪ error detection, correction
▪ LANs
• addressing, ARP
• Ethernet
• switches
▪ data center networking
▪ a day in the life of a web request

Link Layer: 6-9


Multiple access links, protocols
two types of “links”:
▪ point-to-point
• e.g., PPP for dial-up access
▪ broadcast (shared wire or medium)
• Ethernet (wired bus)
• 802.11 wireless LAN, Bluetooth, Zigbee, Lora, 4G/5G/6G, V2X,
satellite

shared wire (e.g., humans at a cocktail party


cabled Ethernet) shared radio: 4G/5G shared radio: WiFi shared radio: satellite
(shared air, acoustical)

Link Layer: 6-10


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 control (MAC)


▪ Coordination of the uses of a shared channel/medium
▪ distributed algorithm that determines how nodes share channel, i.e.,
determine when a node can transmit
▪ Communication about channel sharing must use the channel itself!
• no out-of-band channel for coordination

Link Layer: 6-11


An ideal multiple access protocol
Given: multiple access channel (MAC) of rate R bps
Properties:
1. when one node wants to transmit, it can send at rate R.
2. when M nodes want to transmit, each can send at average
rate R/M (if fairly shared or centrally scheduled), ideally!
3. fully decentralized:
• no special node to coordinate transmissions
• no synchronization of clocks, slots, etc.
4. simple (i.e. easy to implement)

Link Layer: 6-12


MAC protocols: taxonomy
three classes:
▪ channel partitioning (deterministic access) or channelization
• divide a “channel” into smaller “pieces” (time slots, frequency, code)
• allocate a piece to a node for exclusive use
▪ “take turns” (round-robin): deterministic or scheduling
• nodes take turns, but nodes with more to send can take longer turns
▪ random access
• channel not divided, allow collisions
• “recover” from collisions: collision resolution

Link Layer: 6-13


Channel partitioning MAC protocols: TDMA
TDMA: time division multiple access
▪ access to channel in “rounds”
▪ each station gets a slot of fixed length (length = packet
transmission time) in each round
▪ unused slots go idle
▪ example: 6-station LAN, 1,3,4 have packets to send, slots 2,5,6 idle

6-slot time frame 6-slot time frame

1 3 4 1 3 4

Link Layer: 6-14


Channel partitioning MAC protocols: FDMA
FDMA: frequency division multiple access
▪ channel spectrum is divided into frequency bands
▪ each station is assigned to fixed frequency band
▪ unused transmission times in frequency bands go idle
▪ example: 6-station LAN, 1,3,4 have packet to send, frequency bands 2,5,6 idle

frequency bands
FDM cable

Link Layer: 6-15


Channel partition MAC protocols: CDMA
▪ CDMA: Code division multiple access
• Time and frequency are not divided, but orthogonal codes are used
• A user is assigned a code for transmission
• Multiple users could transmit at the same time in the same band without interference
• Similar to language usage: conversations with different languages will not interfere
with each other
• CDMA was popular in 2G/3G cellular systems
• QualComm made its rich from CDMA patents
▪ OFDM: Orthogonal frequency division multiple access
• Not for MAC, but popular with channel partitions
• The most prevalent technologies in wireless industries

Link Layer: 6-16


Random access protocols
▪ when a node has a packet to send
• transmit at full channel data rate R.
• no a priori coordination among nodes (some exceptions)
▪ two or more nodes transmit at the same time → “collision”
▪ random access MAC protocol specifies:
• how to detect collisions: collision detection
• how to recover from collisions (e.g., via delayed retransmissions):
collision resolution
▪ examples of random access MAC protocols:
• ALOHA, slotted ALOHA
• CSMA, CSMA/CD, CSMA/CA
▪ information used in progression:
• Aloha → slotted Aloha → CSMA →CSMA/CD →CSMA/CA
Link Layer: 6-17
Pure ALOHA: no coordination!
▪ Aloha: Hawaiian language, meaning welcome and goodbye
▪ Motivated by linking multiple libraries of the University of Hawaii
on different islands
▪ Developed by Norm Abramson in 1970s
▪ unslotted Aloha: simpler, no synchronization
• Whenever a frame arrives, it is transmitted immediately
▪ collision probability increases with no synchronization:
• frame sent at t0 collides with other frames sent in [t0-1,t0+1]

will overlap will overlap


with start of with end of
i’s frame i’s frame

t0 - 1 t0 t0 + 1
Link Layer: 6-18
Pure ALOHA: will overlap
with start of
i’s frame
will overlap
with end of
i’s frame

efficiency t0 - 1 t0 t0 + 1
▪ Performance: How to evaluate a coordination rule? A good engineer always seeks good design!
▪ Efficiency (throughput): long-run fraction of successful transmissions among all transmissions (many
nodes, all with many frames to send)
▪ Assumptions: N nodes with many frames to send, each transmits with probability p
▪ Then, Pr(success by a given node) = Pr(one node transmits) ·
Pr(no other node transmits in [t0-1,t0] ·
Pr(no other node transmits in [t0,t0+1])
= p . (1-p)N-1 . (1-p)N-1
= p . (1-p)2(N-1)
▪ Assume that each user is independently transmitting (what pure Aloha does!). Then,
S = E(p)=N P(success by a given node) = Np(1-p)2(N-1)
→ Maximal efficiency S = 1/(2e)=.184 when N → ∞

Link Layer: 6-19


Pure ALOHA: efficiency or throughput
Let us derive the maximum efficiency under the assumption that there are a large
number of nodes and each node has a large number of packets to send.
Slotted ALOHA: a little coordination
Assumptions (for operation:
presentation or analysis): ▪ when node obtains fresh
▪ all frames of the same size frame, transmits in next slot
▪ time divided into equal size • if no collision: node can send
slots (time to transmit 1 frame)
new frame in next slot
▪ nodes start to transmit only
slot beginning • if collision: node retransmits
▪ nodes are synchronized frame in each subsequent
slot with probability p until
▪ if 2 or more nodes transmit in
slot, all nodes detect collision success

must use randomization!


Link Layer: 6-21
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: 6-22
Slotted ALOHA: efficiency or throughput
efficiency: long-run fraction of successful slots (many nodes, all with many
frames to send)
▪ Assumptions: N nodes with many frames to send, each transmits in slot
with probability p
• prob that a given node has success in a slot = p(1-p)N-1
• prob that any node has a success = Np(1-p)N-1
• maximum efficiency: find p that maximizes Np(1-p)N-1
• → p = 1/N
• for many nodes, take limit of Np(1-p)N-1 as N goes to infinity, gives:
max efficiency = 1/e = .368
▪ at best: channel used for useful transmissions 36.8% of time!
Link Layer: 6-23
Slotted ALOHA: efficiency or throughput
Efficiency E(p)=Np(1-p)N-1

Let us derive the maximum efficiency under the assumption that there are a large number
of nodes and each node has a large number of packets to send.
Slotted Aloha: efficiency or throughput

at best: channel
used for useful
transmissions 36.8%
of time!
CSMA (carrier sense multiple access): listen before talk
▪ Coordination rule: sense before transmit, or listen before you
speak
▪ How to sense: detect whether there is any transmission activity in
the channel
• Energy or voltage or current…
▪ Many operating modes
• non-persistent
• 1-persistent
• p-persistent

Link Layer: 6-26


Non-persistent CSMA
▪ A station senses the channel
▪ If the channel is busy, it will not continue sensing the channel,
instead, it delays a random time period (backoff), and come back
and listen (sense) again
▪ If the channel is idle, it transmits
▪ If a collision occurs, it will delay a random period of time (backoff),
starts all over again

Link Layer: 6-27


1-persistent CSMA
▪ A station (a user, a transmitter) senses the channel
▪ If the channel is busy, it will wait until the channel is idle (sensing
all the time)
▪ Whenever it senses the channel is idle, it will transmit
▪ If a collision occurs, it will delay a random period of time (backoff),
and start it all over again

Link Layer: 6-28


p-persistent CSMA
▪ Observation: if you sense idle, others too, and collision surely
occurs
▪ p-persist CSMA applies to slotted channels
▪ A station senses the channel
▪ Slotted version: If it senses idle channel, it transmits with
probability p, or defers to next slot with probability q=1-p and
then repeats the same procedure
▪ If it senses busy channel, it delays a random number of slots
(backoff), starts all over again

Link Layer: 6-29


Comparison

Link Layer: 6-30


CSMA/CD: early stoppage
▪If you know your transmission is messed up, stop!
▪CSMA/CD: CSMA with collision detection
• collisions detected within a shorter time
• colliding transmissions aborted, reducing channel wastage
• collision detection easy in wired, difficult in wireless
• human analogy: the polite conversationalist
▪CSMA/CD, widely used in LAN (IEEE 802.3)
• Robert Metcalfe’s PhD thesis at MIT

Link Layer: 6-31


CSMA: collisions spatial layout of nodes

▪ collisions can still occur with


carrier sensing:
• propagation delay means two nodes
may not hear each other’s just-
started transmission
▪ collision: entire packet
transmission time wasted
• distance & propagation delay play
role in determining collision
probability

Link Layer: 6-32


CSMA/CD: spatial layout of nodes

▪ CSMA/CD reduces the amount of


time wasted in collisions
• transmission aborted on collision
detection

Link Layer: 6-33


Ethernet CSMA/CD algorithm
1. NIC receives datagram (packet) from network layer, creates frame
2. If NIC senses channel:
if idle: start frame transmission.
if busy: wait until channel idle, then transmit (p-persistent CSMA may be
adopted)
3. If NIC transmits entire frame without collision, NIC is done with frame.
4. If NIC detects another transmission while transmitting: abort
5. After aborting, NIC enters binary (exponential) backoff:
• after the m-th collision, NIC chooses K at random from {0,1,2, …, 2m-1}. NIC
waits K·512 bit times, returns to Step 2
• more collisions: longer backoff interval Backoff interval is reset for new frame!

Link Layer: 6-34


CSMA/CD: efficiency or throughput
▪ tprop = max prop delay between 2 nodes in LAN (two furthest nodes)
▪ ttrans = time to transmit max-size frame
1
efficiency =
1 + 5t prop /ttrans
▪ efficiency goes to 1
• as tprop goes to 0
• as ttrans goes to infinity
▪ better performance than ALOHA: still simple, decentralized!

Link Layer: 6-35


CSMA/CA: wireless
▪ CSMA/CD does not work well in a wireless channel
• difficult to detect collisions in a radio environment
• difficult to control the wireless channel
• hidden and exposed terminal problems
▪ CA: Collision Avoidance
▪ CSMA/CA is used in wireless environments
• sense before transmit (CSMA)
• gain the access right via time-spacing and/or contention (slotted Aloha)
• wait for channel grant of usage (let the receiver tell the status)
• busy-tone may be used
• IEEE 802.11x standard
• There are many variants in wireless protocols

Link Layer: 6-36


“Taking turns” MAC protocols: time-sharing
channel partitioning MAC protocols:
▪ share channel efficiently and fairly at high load
▪ inefficient at low load: delay in channel access, 1/N bandwidth
allocated even if only 1 active node!
random access MAC protocols
▪ efficient at low load: single node can fully utilize channel
▪ high load: collision overhead
“taking turns” protocols
▪ look for the best of both worlds!

Link Layer: 6-37


“Taking turns” MAC protocols
polling:
▪ access is structured into rounds.
▪ each node gets its turn during a data
poll
round.
▪ master node “invites” nodes to master
data
transmit (one after the other)
▪ typically used with “simple”
devices
▪ concerns: hosts

• polling delay (time dpoll)


• Single-point failure (master)
Link Layer: 6-38
“Taking turns” MAC protocols
T
token passing:
▪ control token passed from one
node to next sequentially.
(nothing
• token message (short to send)
packet) T
• token is the access right
▪ concerns:
• token overhead
• latency
• Single-point failure (token) data

Link Layer: 6-39


Summary of MAC protocols
▪ channel partitioning, by time, frequency or code
• Time Division, Frequency Division, code division
▪ random access (dynamic),
• ALOHA, S-ALOHA, CSMA, CSMA/CD
• carrier sensing: easy in some technologies (wire), hard in others
(wireless)
• CSMA/CD used in Ethernet
• CSMA/CA used in 802.11
▪ taking turns
• polling from central site, token passing
• Bluetooth (TDMA)

Link Layer: 6-40


Link layer, LANs: roadmap
▪ introduction
Chapter 6
▪ multiple access protocols
▪ error detection, correction
▪ LANs
• addressing, ARP
• Ethernet
• switches
▪ data center networking
▪ a day in the life of a web request

Link Layer: 6-41


Error detection
EDC: error detection and correction bits (e.g., redundancy)
D: data protected by error checking, may include header fields

datagram datagram Error detection not 100%


Yes
reliable!
all
bits in D’ No ▪ protocol may miss
OK detected some errors (rarely)
? error
d data bits ▪ larger EDC field yields
D EDC D’ EDC’ better detection and
correction, but more
bit-error prone link overhead, a tradeoff!

Link Layer: 6-42


Fundamental idea for EDC
▪ Link/channel condition is not ideal, transmission error does occur, and
needs to tell right or wrong!
▪ Basic idea: frame is so constructed that a certain relationship among
all bits in the frame is embedded. If the received frame does not have
that relationship, then something must be wrong with the received
frame!
▪ Redundancy bits or the check bits (“relationship”) are added by the
transmitter for error detection, and the receiver checks it!

Link Layer: 6-43


Parity checking
single bit parity: two-dimensional bit parity:
▪ detect single bit errors ▪ detect and correct single bit errors
row parity
0111000110101011 1
d1,1 ... d1,j d1,j+1
d data bits d2,1 ... d2,j d2,j+1
parity ... ... ... ...
bit di,1 ... di,j di,j+1
column
parity di+1,1 ...
Even parity: set parity di+1,j di+1,j+1
bit so there is an even
number of 1’s
no errors: 1 0 1 0 1 1 detected 10101 1
• count the number of and parity
11110 0 10110 0 error
1s: set to 1 when it is correctable(!)
01110 1 single-bit 01110 1
odd and 0 otherwise
00101 0 error: 00101 0
• Modulo-2 sum of all
parity
bits error
Link Layer: 6-44
Internet checksum (review)
Goal: detect errors (i.e., flipped bits) in transmitted segment
sender: receiver:
▪ treat contents of UDP ▪ compute checksum of received
segment (including UDP header segment
fields and IP addresses) as
sequence of 16-bit integers ▪ check if computed checksum equals
▪ checksum: addition (one’s checksum field value:
complement sum) of segment • not equal - error detected
content • equal - no error detected. But maybe
errors nonetheless? More later ….
▪ checksum value put into
UDP frame checksum field
(FCS)
Transport Layer: 3-45
Cyclic Redundancy Check (CRC)
▪ more powerful error-detection coding
▪ D: data bits (given, think of these as a binary number)
▪ G: bit pattern (generator), of r+1 bits (given)
r CRC bits
d data bits
D R bit pattern
<D,R> = D *2r XOR R formula for bit pattern

goal: choose r CRC bits, R, such that <D,R> exactly divisible by G (mod 2)
• receiver knows G, divides <D,R> by G. If non-zero remainder: error detected!
• can detect all burst errors of up to r bits
• widely used in practice (Ethernet, 802.11 WiFi)
Link Layer: 6-46
Cyclic Redundancy Check (CRC): example
We want: G
D.2r XOR R = nG 1 0 0 1 1 0 1 1 1 0 0 0 0
or equivalently:
D.2r = nG XOR R D * 2r
or equivalently:
if we divide D.2r by G, want R
to satisfy:
D . 2r
R = remainder [ ]
G

Link Layer: 6-47


Cyclic redundancy check

r+1

r
Cyclic redundancy check

1 0 1 0
In each step: check the leading
most significant bit

• If it’s 0: place a 0 in the


quotient and XOR the
current bits with 000.

• If it’s 1: place a 1 in the


quotient and XOR the
current bits with the divisor
Two Cases at the Receiver Side

1 0 1 0 1 0 1 0
Clarification: CRC Error Detection
A polynomial representing a divisor (generator)

51
Standard polynomials

Name Polynomial Application

CRC-8 x 8 + x2 + x + 1 ATM header


CRC-10 x10 + x9 + x5 + x4 + x 2 + 1 ATM AAL
ITU-16 x16 + x12 + x5 + 1 HDLC
x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10
ITU-32 LANs
+ x8 + x7 + x5 + x4 + x2 + x + 1
Cyclic Redundancy Check (CRC): example
We want: G 1 0 1 0 1 1
D.2r XOR R = nG 1 0 0 1 1 0 1 1 1 0 0 0 0
or equivalently: 1 0 0 1
D.2r = nG XOR R 1 0 1 D * 2r
0 0 0
or equivalently: 1 0 1 0
1 0 0 1
if we divide D.2r by G, want R 1 1 0
to satisfy: 0 0 0
D . 2r 1 1 0 0
R = remainder [ ] 1 0 0 1
G 1 0 1 0
1 0 0 1
0 1 1
R
Link Layer: 6-53
Link layer, LANs: roadmap
▪ introduction
Chapter 6
▪ multiple access protocols
▪ error detection, correction
▪ LANs
• addressing, ARP
• Ethernet
• switches
▪ data center networking
▪ a day in the life of a web request

Link Layer: 6-54


MAC addresses
▪ 32-bit IP address to identify a user in Internet:
• Network-layer address for an interface
• used for layer 3 (network layer) forwarding
• e.g.: 128.119.40.136
▪ MAC (or LAN or physical or Ethernet) address to identify a device:
• 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) in NIC ROM, also sometimes software
settable
• e.g.: 1A-2F-BB-76-09-AD
hexadecimal (base 16) notation
(each “numeral” represents 4 bits)
Link Layer: 6-55
MAC addresses
each interface on LAN
▪ has a (globally) 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

Link Layer: 6-56


MAC addresses
▪ MAC address allocation administered by IEEE
▪ manufacturer buys portion of MAC address space (to
assure uniqueness)
▪ analogy:
• MAC address: like HKID, Social Security Number (USA)
• IP address: like postal address or student ID
▪ Flat address space: portability
• can move interface from one LAN to another, MAC addr fixed
• recall IP address not portable: depends on IP subnet to which
node is attached
Link Layer: 6-57
ARP: address resolution protocol
Question: how to determine interface’s MAC address, given the IP address
of the interface? (another question: how to find IP address from MAC
address?) ARP table: each IP node (host,
ARP
router) on LAN has a table
137.196.7.78
ARP
1A-2F-BB-76-09-AD • IP/MAC address mappings for
ARP some LAN nodes:
LAN < IP address; MAC address; TTL>
71-65-F7-2B-08-53
137.196.7.23
58-23-D7-FA-20-B0
137.196.7.14 • TTL (Time To Live): time after
ARP 0C-C4-11-6F-E3-98 which address mapping will be
137.196.7.88
forgotten (typically 20 min)

Link Layer: 6-58


ARP protocol in action
example: A wants to send datagram to B
• B’s MAC address not in A’s ARP table, so A uses ARP to find B’s MAC address

A broadcasts ARP query, containing B's IP addr


Ethernet frame (sent to FF-FF-FF-FF-FF-FF)
1 • destination MAC address = FF-FF-FF-FF-FF-FF
• all nodes on LAN receive ARP query C Source MAC: 71-65-F7-2B-08-53
Source IP: 137.196.7.23
ARP table in A Target IP address: 137.196.7.14

IP addr MAC addr TTL
TTL
A B
1
71-65-F7-2B-08-53 58-23-D7-FA-20-B0
137.196.7.23 137.196.7.14

D
Link Layer: 6-59
ARP protocol in action
example: A wants to send datagram to B
• B’s MAC address not in A’s ARP table, so A uses ARP to find B’s MAC address

ARP message into Ethernet frame


(sent to 71-65-F7-2B-08-53)
C Target IP address: 137.196.7.14
Target MAC address:
ARP table in A 58-23-D7-FA-20-B0

IP addr MAC addr TTL
TTL
A B
2
71-65-F7-2B-08-53 58-23-D7-FA-20-B0
137.196.7.23 137.196.7.14

2 B replies to A with ARP response,


giving its MAC address
D
Link Layer: 6-60
ARP protocol in action
example: A wants to send datagram to B
• B’s MAC address not in A’s ARP table, so A uses ARP to find B’s MAC address

C
ARP table in A
IP addr MAC addr TTL
TTL
137.196.
A B
58-23-D7-FA-20-B0 500
7.14

71-65-F7-2B-08-53 58-23-D7-FA-20-B0
137.196.7.23 137.196.7.14

3 A receives B’s reply, adds B entry


into its local ARP table
D
Link Layer: 6-61
Routing to another subnet: addressing
walkthrough: sending a datagram from A to B via R
▪ focus on addressing – at IP (datagram) and MAC layer (frame) levels
▪ assume that:
• A knows B’s IP address
• A knows IP address of first hop router, R (how?)
• A knows R’s MAC address (how?)

A B
R
111.111.111.111
74-29-9C-E8-FF-55 222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
111.111.111.112 111.111.111.110
CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 222.222.222.221
88-B2-2F-54-1A-0F
Link Layer: 6-62
Routing to another subnet: addressing
▪ A creates IP datagram with IP source A, destination B
▪ A creates link-layer frame containing A-to-B IP datagram
• R's MAC address is frame’s destination
MAC src: 74-29-9C-E8-FF-55
MAC dest: E6-E9-00-17-BB-4B
IP src: 111.111.111.111
IP dest: 222.222.222.222

IP
Eth
Phy

A B
R
111.111.111.111
74-29-9C-E8-FF-55 222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
111.111.111.112 111.111.111.110
CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 222.222.222.221
88-B2-2F-54-1A-0F
Link Layer: 6-63
Routing to another subnet: addressing
▪ frame sent from A to R
▪ frame received at R, datagram removed, passed up to IP
IP src: 111.111.111.111
IP dest: 222.222.222.222
MAC src: 74-29-9C-E8-FF-55
MAC dest: E6-E9-00-17-BB-4B
IP src: 111.111.111.111
IP dest: 222.222.222.222

IP IP
Eth Eth
Phy Phy

A B
R
111.111.111.111
74-29-9C-E8-FF-55 222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
111.111.111.112 111.111.111.110
CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 222.222.222.221
88-B2-2F-54-1A-0F
Link Layer: 6-64
Routing to another subnet: addressing
▪ R determines outgoing interface, passes datagram with IP source A, destination B
to link layer
▪ R creates link-layer frame containing A-to-B IP datagram. Frame destination
address: B's MAC address
MAC src: 1A-23-F9-CD-06-9B
MAC dest: 49-BD-D2-C7-56-2A
IP src: 111.111.111.111
IP dest: 222.222.222.222

IP
Eth
Phy

A B
R
111.111.111.111
74-29-9C-E8-FF-55 222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
111.111.111.112 111.111.111.110
CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 222.222.222.221
88-B2-2F-54-1A-0F
Link Layer: 6-65
Routing to another subnet: addressing
▪ R determines outgoing interface, passes datagram with IP source A, destination B
to link layer
▪ R creates link-layer frame containing A-to-B IP datagram. Frame destination
address: B's MAC address
MAC src: 1A-23-F9-CD-06-9B
▪ transmits link-layer frame MAC dest: 49-BD-D2-C7-56-2A
IP src: 111.111.111.111
IP dest: 222.222.222.222
IP
IP Eth
Eth Phy
Phy

A B
R
111.111.111.111
74-29-9C-E8-FF-55 222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
111.111.111.112 111.111.111.110
CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 222.222.222.221
88-B2-2F-54-1A-0F
Link Layer: 6-66
Routing to another subnet: addressing
▪ B receives frame, extracts IP datagram destination B
▪ B passes datagram up protocol stack to IP

IP src: 111.111.111.111
IP dest: 222.222.222.222

IP
IP Eth
Eth Phy
Phy

A B
R
111.111.111.111
74-29-9C-E8-FF-55 222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
111.111.111.112 111.111.111.110
CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 222.222.222.221
88-B2-2F-54-1A-0F
Link Layer: 6-67
Link layer, LANs: roadmap
▪ introduction
Chapter 6
▪ multiple access protocols
▪ error detection, correction
▪ LANs
• addressing, ARP
• Ethernet
• switches
▪ data center networking
▪ a day in the life of a web request

Link Layer: 6-68


Ethernet switch
▪ Switch is a link-layer device: takes active roles
• store, forward Ethernet frames
• examine incoming frame’s MAC address, and
selectively forward frame to one-or-more outgoing links,
uses CSMA/CD to access each link
▪ transparent: hosts unaware of presence of switches
▪ plug-and-play, self-learning
• switches do not need to be configured

Link Layer: 6-69


Ethernet
“dominant” wired LAN technology:
▪ first widely used LAN technology
▪ simpler, cheap
▪ kept up with speed race: 10 Mbps – 400 Gbps
▪ single chip, multiple speeds (e.g., Broadcom BCM5761)

Metcalfe’s Ethernet
sketch
https://www.uspto.gov/learning-and-resources/journeys-innovation/audio-stories/defying-doubters Link Layer: 6-70
Ethernet: physical topology
▪ bus: popular through mid 90s
• all nodes in same collision domain (can collide with each other)
▪ switched: prevails today
• active link-layer 2 switch in center
• each “spoke” runs a (separate) Ethernet protocol (nodes do not collide with
each other)

bus: coaxial cable switched

Link Layer: 6-71


Ethernet frame structure
sending interface encapsulates IP datagram (or other network layer
protocol packet) in Ethernet frame
type
dest. source data (payload) CRC
preamble address address

preamble:
▪ used to synchronize receiver, sender clock rates
▪ 7 bytes of 10101010 followed by one byte of 10101011

Link Layer: 6-72


Ethernet frame structure (more)
type
dest. source data (payload) CRC
preamble address address

▪ addresses: 6 byte source, destination MAC addresses


• if adapter receives frame with matching destination address, or with broadcast
address (e.g., ARP packet), it passes data in frame to network layer protocol
• otherwise, adapter discards frame
▪ type: indicates higher layer protocol
• mostly IP but others possible, e.g., Novell IPX, AppleTalk
• used to demultiplex up at receiver
▪ CRC: cyclic redundancy check at receiver
• error detected: frame is dropped
Link Layer: 6-73
Ethernet: unreliable, connectionless
▪connectionless: no handshaking between sending and
receiving NICs
▪unreliable: receiving NIC does not send ACKs or NAKs to
sending NIC
• data in dropped frames recovered only if initial sender uses
higher layer rdt (e.g., TCP), otherwise dropped data lost
▪Ethernet’s MAC protocol: unslotted CSMA/CD with binary
backoff

Link Layer: 6-74


802.3 Ethernet standards: link & physical layers

▪ many different Ethernet standards


• common MAC protocol and frame format
• different speeds: 2 Mbps, 10 Mbps, 100 Mbps, 1Gbps, 10 Gbps, 40 Gbps
• different physical layer media: fiber, cable

MAC protocol
application
and frame format
transport
network 100BASE-TX 100BASE-T2 100BASE-FX
link 100BASE-T4 100BASE-SX 100BASE-BX
physical

copper (twister pair) physical layer fiber physical layer


Link Layer: 6-75
Switch: multiple simultaneous transmissions
▪ Switched Ethernet
▪ hosts have dedicated, direct A
connections to switch C’ B
▪ switches buffer packets
1 2
▪ Ethernet protocol used on each 6
incoming link, so: 5
3
4
• no collisions; full duplex
• each link is its own collision domain B’
A’
C
▪ switching: A-to-A’ and B-to-B’ can transmit
simultaneously, without collisions switch with six
interfaces (1,2,3,4,5,6)

Link Layer: 6-76


Switch: multiple simultaneous transmissions
▪ hosts have dedicated, direct
connection to switch A
▪ switches buffer packets C’ B
▪ Ethernet protocol used on each 1 2
incoming link, so: 6
3
• no collisions; full duplex 5 4
• each link is its own collision
domain B’ C
A’
▪ switching: A-to-A’ and B-to-B’ can transmit
simultaneously, without collisions switch with six
interfaces (1,2,3,4,5,6)
• but A-to-A’ and C to A’ cannot transmit
simultaneously
Link Layer: 6-77
Switch table
Q: how does switch know A’ reachable via
interface 4, B’ reachable via interface 5? A
C’ B
A: a switch has a switch table:
1 2
▪ each entry: (MAC address of host, 6
interface to reach host, time stamp) 3
5 4
▪ looks like a forwarding table!
B’ C
A’
Q: how are entries created,
maintained in switch table?
▪ something like a routing protocol?

Link Layer: 6-78


Switch: self-learning
Source: A

▪ switch learns which hosts Dest: A’

A A’
can be reached through A
which interfaces C’ B
• when frame received, switch 1 2
6
“learns” location of sender: 3
5
incoming LAN segment 4

• records sender/location pair B’ C


A’
in switch table
Switch table
MAC addr interface TTL (initially empty)
A 1 60

Link Layer: 6-79


Switch: frame filtering/forwarding
when frame received at switch:
1. record incoming link, MAC address of sending host
2. index switch table using MAC destination address
3. if entry found for destination
then {
if destination on segment from which frame arrived
then drop frame
else forward frame on interface indicated by entry
}
else flood /* forward on all interfaces except arriving interface */

Link Layer: 6-80


Self-learning, forwarding: example Source: A
Dest: A’

▪ frame destination, A’, A A’


location unknown: flood A
C’ B
▪ destination A location
1
known: selectively send 6A A’
2

on just one link 3


5 4

B’ C
A’ A A’

MAC addr interface TTL


A 1 60 switch table
A’ 4 60 (initially empty)

Link Layer: 6-81


Interconnecting switches
self-learning switches can be connected together:

S4

S1
S3
A S2
F
D I
B C
G H
E

Q: sending from A to G - how does S1 know to forward frame destined to


G via S4 and S3?
▪ A: self learning! (works exactly the same as in single-switch case!)

Link Layer: 6-82


Self-learning multi-switch example
Suppose C sends frame to I, I responds to C
S4

S1
S3
A S2
F
D I
B C
G H
E

Q: show switch tables and packet forwarding in S1, S2, S3, S4

Link Layer: 6-83


Switches vs. routers application
transport
both are store-and-forward: datagram
frame
network
link
▪ routers: network-layer devices (examine physical link frame
network-layer headers) physical

▪ switches: link-layer devices (examine switch


link-layer headers) network datagram
link
both have forwarding tables: physical
frame

▪ routers: compute tables using routing application


algorithms, IP addresses transport
▪ switches: learn forwarding table using network
link
flooding, learning, MAC addresses physical

6-846-84
Link Layer:
Small institutional network

mail server
to external
network
router web server

IP subnet

Link Layer: 6-85


Link layer, LANs: roadmap
▪ introduction
Chapter 6
▪ multiple access protocols
▪ error detection, correction
▪ LANs
• addressing, ARP
• switches
▪ data center networking
▪ a day in the life of a web request

Link Layer: 6-86


Datacenter networks
10’s to 100’s of thousands of hosts, often closely coupled, in
close proximity:
▪ e-business (e.g., Amazon)
▪ content-servers (e.g., YouTube, Akamai, Apple, Microsoft)
▪ search engines, data mining (e.g., Google)

challenges:
▪ multiple applications, each serving
massive numbers of clients/users
▪ reliability
▪ managing/balancing load, avoiding
processing, networking, data
Inside a 40-ft Microsoft container, Chicago data center
bottlenecks
Link Layer: 6-87
Datacenter networks: network elements
Border routers
▪ connections outside datacenter

Tier-1 switches
▪ connecting to ~16 T-2s below

Tier-2 switches
▪ connecting to ~16 TORs below
… … … …
Top of Rack (TOR) switch
… … … … ▪ one per rack
▪ 40-100Gbps Ethernet to blades
Server racks
▪ 20- 40 server blades: hosts

Link Layer: 6-88


Datacenter networks: multipath
▪ rich interconnection among switches, racks:
• increased throughput between racks (multiple routing paths possible)
• increased reliability via redundancy

9 10 11 12 13 14 15 16

two disjoint paths highlighted between racks 1 and 11 (red and blue)
Link Layer: 6-89
Datacenter networks: application-layer routing
Internet
load balancer:
application-layer
routing
▪ receives external
Load client requests
balancer
▪ directs workload
within data center
… … … … ▪ returns results to
external client
… … … …
(hiding data center
internals from client)

Link Layer: 6-90


Datacenter networks: network elements
Facebook F16 data center network topology:

https://engineering.fb.com/data-center-engineering/f16-minipack/ (posted 3/2019)


Link Layer: 6-91
Datacenter networks: protocol innovations
▪ link layer:
• RoCE: remote DMA (RDMA) over Converged Ethernet
▪ transport layer:
• ECN (explicit congestion notification) used in transport-layer congestion
control (DCTCP, DCQCN)
• experimentation with hop-by-hop (backpressure) congestion control
▪ routing, management:
• SDN widely used within/among organizations’ datacenters
• place related services, data as close as possible (e.g., in same rack or nearby
rack) to minimize tier-2, tier-1 communication

Link Layer: 6-92


Link layer, LANs: roadmap
▪ introduction
Chapter 6
▪ multiple access protocols
▪ error detection, correction
▪ LANs
• addressing, ARP
• switches
▪ data center networking
▪ a day in the life of a web request
Synthesis: a day in the life of a web request
▪ our journey down the protocol stack is now complete!
• application, transport, network, link
▪ putting-it-all-together: synthesis!
• goal: identify, review, understand protocols (at all layers) involved in
seemingly simple scenario: requesting www page
• scenario: student attaches laptop to campus network, requests/receives
www.google.com

Link Layer: 6-94


A day in the life: scenario
scenario:
browser DNS server ▪ arriving mobile
Comcast network client attaches
68.80.0.0/13 to network …
▪ requests web
school network page:
68.80.2.0/24 www.google.com
web page

Sounds
web server
simple!
Google’s network
64.233.169.105 64.233.160.0/19

Link Layer: 6-95


A day in the life: connecting to the Internet
DHCP
DHCP
DHCP
UDP
▪ connecting laptop needs to get its own IP
DHCP IP address, addr of first-hop router, addr of
Eth arriving mobile:
DHCP
Phy DHCP client DNS server: use DHCP
DHCP

▪ DHCP request encapsulated in UDP,


DHCP DHCP encapsulated in IP, encapsulated in 802.3
UDP
DHCP
DHCP IP
Ethernet
DHCP Eth
Phy
router has
▪ Ethernet frame broadcast (dest:
DHCP server FFFFFFFFFFFF) on LAN, received at router
running DHCP server
▪ Ethernet demuxed to IP demuxed, UDP
demuxed to DHCP
Link Layer: 6-96
A day in the life: connecting to the Internet
DHCP
DHCP UDP ▪ DHCP server formulates DHCP ACK
DHCP IP containing client’s IP address, IP address
DHCP Eth arriving mobile:
DHCP Phy DHCP client of first-hop router for client, name & IP
address of DNS server
DHCP
DHCP ▪ encapsulation at DHCP server, frame
DHCP
DHCP
UDP forwarded (switch learning) through LAN,
IP
DHCP
Eth demultiplexing at client
DHCP Phy
router has
DHCP server ▪ DHCP client receives DHCP ACK reply

Client now has IP address, knows name & addr of DNS


server, IP address of its first-hop router
Link Layer: 6-97
A day in the life… ARP (before DNS, before HTTP)
DNS DNS ▪ before sending HTTP request, need IP address
DNS UDP
DNS
ARP IP
of www.google.com: DNS
ARP query Eth arriving mobile:
Phy ARP client ▪ DNS query created, encapsulated in UDP,
encapsulated in IP, encapsulated in Eth. To
send frame to router, need MAC address of
router interface: ARP
ARP ▪ ARP query broadcast, received by router, which
ARP reply Eth
Phy
replies with ARP reply giving MAC address of
router has router interface
ARP server
▪ client now knows MAC address of first hop
router, so can now send frame containing
DNS query

Link Layer: 6-98


A day in the life… using DNS
DNS
DNS DNS
DNS UDP
DNS DNS ▪ demuxed to DNS
DNS UDP
DNS IP
DNS IP ▪ DNS replies to client
Eth DNS
DNS Phy
DNS Eth
server
with IP address of
DNS Phy
www.google.com

Comcast network
68.80.0.0/13

▪ IP datagram
▪ IP datagram forwarded from campus
containing DNS query
forwarded via LAN network into Comcast network,
routed (tables created by RIP, OSPF,
switch from client to
1st hop router IS-IS and/or BGP routing protocols)
to DNS server
Link Layer: 6-99
A day in the life…TCP connection carrying HTTP
HTTP
HTTP ▪ to send HTTP request,
SYNACK
SYN TCP
SYNACK
SYN IP client first opens TCP
SYNACK
SYN Eth socket to web server
Phy Comcast network
68.80.0.0/13
▪ TCP SYN segment (step 1 in
TCP 3-way handshake) inter-
domain routed to web server
▪ web server responds with
TCP
SYNACK
SYN

SYNACK
SYN IP
TCP SYNACK (step 2 in TCP 3-
SYNACK
SYN Eth way handshake)
Phy

Google web server


▪ TCP connection established!
64.233.169.105

Link Layer: 6-100


A day in the life… HTTP request/reply
HTTP
HTTP
HTTP
HTTP
HTTP
TCP
▪ HTTP request sent into
HTTP
HTTP IP ▪ web page finally (!!!) TCP socket
HTTP
HTTP Eth displayed
Phy Comcast network ▪ IP datagram containing
68.80.0.0/13
HTTP request routed to
www.google.com
▪ web server responds with
HTTP
HTTP
HTTP
TCP
HTTP reply (containing web
HTTP
IP page)
HTTP
Eth
Phy ▪ IP datagram containing
Google web server HTTP reply routed back to
64.233.169.105
client
Link Layer: 6-101
Cyclic redundancy check

r+1

r
Cyclic redundancy check

In each step: check the


1 0 1 0
leading most significant bit

• If it’s 0: place a 0 in the


quotient and XOR the
current bits with 000.

• If it’s 1: place a 1 in the


quotient and XOR the
current bits with the divisor
1. A bit stream 10011101 is transmitted using the standard CRC method. The
generator polynomial is x3+1. (i) Show the actual bit string transmitted. (ii)
Suppose the third bit from the left is inverted during transmissions. Explain how
this error is detected at the receiver's end.
Lool
xitf =

10011 co 1000
cool

靈 如
0000



1. A bit stream 10011101 is transmitted using the standard CRC method. The
generator polynomial is x3+1. Show the actual bit string transmitted. Suppose
the third bit from the left is inverted during transmissions. Explain how this error
is detected at the receiver's end.

Answer:
• Since the polynomial is x3+1, it is 1*x3+0*x2+0*x1+1*x0, the
divisor (i.e. generator) is 1001.
• Thus, the remainder will have 4-1 = 3 bits.

• 10011101000 is divided by 1001, the remainder is 100.


• Thus, the actual bit string transmitted is: 10011101100.

• If the received bit string is 10111101100, then when


10111101100 is divided by 1001, the remainder is 100.
• The receiver will know that an error has happened.
2. Three users X, Y and Z use a shared link to connect to the Internet. Only one of
X, Y and Z can use the link at any given time, and the link has a capacity of 1
Mbps. Suppose that TDMA is used. Each time frame is divided into 3 equal time
slots, one for each user. Does the TDMA work for the following two cases?
Justify your answers.
a) X, Y and Z send a 40Kbytes file every 1sec.

Answer:
• X, Y, or Z needs to send 40*8 K bits/second=0.32M bits/second.

• With TDMA, for a link with 1Mbps bandwidth, each user will be
able to transmit 0.333Mbps.

• Thus, TDMA will allow all users to transmit their data immediately.
It works fine.
2. Three users X, Y and Z use a shared link to connect to the Internet. Only one of
X, Y and Z can use the link at any given time, and the link has a capacity of 1
Mbps. Suppose that TDMA is used. Each time frame is divided into 3 equal time
slots, one for each user. Does the TDMA work for the following two cases?
Justify your answers.
b) X sends 80Kbytes files per sec, while Y and Z send 10 Kbytes files per sec.

Answer:
• X needs to send 640K bits per second, each of Y and Z needs to send 80K
bits per second. The total of 800K (=640K+160K) bits per second is less than
1M (=1,000K) bits per second.

• However, if TDMA is adopted, X will not be able to send 640K bits per
second as it is only allowed to transmit at 1/3 bandwidth per second
(333Kbps). Y and Z will waste some allocated bandwidth as they do not have
much data to transmit.

• TDMA does not work in this case.


3) Suppose that there are 4 nodes in a network using slotted ALOHA. Each node
has a large number of packets to send. Suppose that each node will have
probability ¼ to retransmit a packet after a collision happens. What will be the
efficiency of the network?

Answer: N=4 and p=1/4

The maximum efficiency of each user is


p(1-p) N-1=1/4*(1-1/4)3=27/256=10.5%

• The efficiency of the network is


• N*p(1-1/p) N-1=4*1/4*(1-1/4)3=27/64=42%.
4) Suppose that there are three nodes seeking access to a shared medium using
slotted ALOHA, where each packet takes one time slot to transmit. Assume that
each node has many packets to send, and node i has probability pi of sending a
packet in each time slot with i = 1, 2, 3. Suppose that the sending probabilities of
the three nodes are p1 = 2p and p2 = p3=p, respectively.
a) What is the efficiency of the shared medium?

Answer: p1 = 2p and p2 = p3=p,


• the utilization/efficiency of the shared medium is:

• p1(1-p2)(1-p3) + p2(1-p1)(1-p3) + p3(1-p1)(1-p2)


• = 2p(1-p)2+2p(1-2p)(1-p)
• = 6p3 -10p2+4p

• Let E(p)= 6p3 -10p2+4p


4) Suppose that there are three nodes seeking access to a shared medium using
slotted Aloha, where each packet takes one slot to transmit. Assume that each
node has a lot of packets to send, and that node i has probability pi of sending a
packet in each slot, for i = 1, 2, 3. Suppose that we assign the sending
probabilities so that p1 = 2p and p2 = p3=p.
b) What are the probabilities that maximize the utilization? and what is the
corresponding utilization?

Answer:

屁啊噩
• E(p) = 6p3 -10p2+4p. z 0 ±
36
• To maximize the value of E(p), we have E’(p)=18p2-20p+4=0,
• when p =(5-sqrt(7))/9 =0.2616, the value of E(p) is maximized. The other
solution p=(5+sqrt(7))/9 that will result in p1 larger than 1 is discarded.
• Thus, p1=0.5232, p2=p3=0.2616, will maximize the efficiency, and the
efficiency is: E(p)=6*0.26163-10*0.26162+4*0.2616 =0.4695
5) Give an example where the two-dimensional parity scheme detects but cannot correct
a double-bit error.
Answer:
• Suppose we begin with the initial two-dimensional parity matrix:
000|0
111|1
010|1
101|0
• With a bit error in row 2, column 3, the parity of row 2 and column 3 is now wrong in the
matrix below, and hence we can detect the error at position (2,3):

000|0
110|1
010|1
101|0

• Now suppose there are bit errors in row 2, column 2, and row 2, column 3, respectively.
• The parity of row 2 is now correct.
• The parity of columns 2 and 3 is wrong. But we can’t detect in which rows the error
occurred.

000|0
100|1
010|1
101|0
• The above example shows that a double bit error can be detected but not corrected.
1. Suppose that the sender uses CRC with general polynomial x4 + x2 + 1 for error
detection over a link. What is the bit string used as divisor (i.e., the generator)
for computing the CRC bits?

Answer:
• Since the polynomial is 1*x4+0*x3+1*x2+0*x1+1*x0, the
divisor (i.e. generator) is 10101.
2) Consider the LAN below consisting of 12 computers connected by two self-
learning Ethernet switches. At t=0, the switch table entries for both switches are
empty. For each of the following frame transmissions (and their replies),
state (1) what information the switches learn, and
(2) to which hosts the frame will be forwarded.
(a) t=1: C -> G, G -> C
(b) t=2: C -> D, D -> C
(c) t=3: B -> G , G -> B

Answer: Let S1 be the left switch and S2 the right switch.


(a): C -> G: S2 learns (C,3), S1 learns (C,8). Frame is sent to everyone.
G -> C: S1 learns (G,10), S2 learns (G,7). Frame is sent only to C.
(b): C -> D: nothing new added to the tables; frame is sent to everyone.
D -> C: S2 learns (D,4). Frame is sent only to C.
(c): B -> G: S2 learns (B,2). S1 learns (B,8). Frame is sent only to G.
G -> B: nothing new added to the tables; frame is sent only to B.
3) Suppose that we are using the polling MAC protocol to control the access of 4
nodes to a broadcast channel. Assume that the channel has a transmission rate
of 2 Mbps. There is an additional polling node (which notifies each of the nodes
when it can transmit in a round robin fashion), and the polling delay is dpoll = 100
msec. Each node can transmit 0.25 Mbits in each round. What is the length (in
sec) of a polling round?

Answer:
• Recall that the polling delay is the amount of time required to notify a
node that it can transmit.
• Each node needs to be invited by the polling node before it can send.
• A round ends once every node has had its turn.
• Thus we need to add the delay dpoll four times in a single round.
• The total time for a round is:
4 * (dpoll + L/R)
• = 4 * (0.1 + 0.25 / 2)
• = 0.9 seconds

You might also like