Professional Documents
Culture Documents
sc250 04 11.exos
sc250 04 11.exos
Computer Networking I
Link Layer:
Exercises
Prof. Matthias Grossglauser
LCA/I&C
http://lcawww.epfl.ch
1
Performance of Slotted ALOHA
We had seen that with N active nodes (i.e., nodes that
have frames waiting to be sent),
E(p) = Prob{frame sent successfully} = Np(1-p)N-1
Questions:
What is the value p* of p that maximizes E(p)?
What is E(p) when N -> infinity, with the optimal choice of p =
p*?
Answer:
Sup_p E(p) can be found by computing dE(p)/dp = 0 (because
sup does not lie on boundaries); this gives p*=1/N
Using (1-1/x)x -> 1/e, this gives E(p*) = 1/e.
2
Performance of Pure ALOHA
Recall that pure ALOHA, a frame transmission can start
at any time, rather than only on a slot boundary
Question:
Carry out the corresponding calculation from the previous
question
Answer:
Consider a slot during which a particular node attempts to
send a frame. Note that if the start of a transmission by
another node falls into this slot or into the previous slot
(see class notes), then a collision results.
This translates into Epure(p) = Np(1-p)2(N-1)
A similar calculation as before gives Epure(p*) -> (2e)-1 for large
N
3
ARP (Address Resolution Protocol)
Given this topology, and LAN1=111.111.111/24,
LAN2=222.222.222/24, and LAN3=333.333.333/24
Assign IP addresses to all interfaces (adapters)
Enumerate steps taken by a packet A->E, when all ARP tables
are initially empty
Enumerate steps for second packet A->E, with up-to-date ARP
tables
A
R1 R2
B
E
LAN1
LAN3
C D
4
LAN2
ARP (Address Resolution Protocol)
A possible address allocation
222.222.222.4
333.333.333.1
222.222.222.1
A 111.111.111.1
R1 R2
B
111.111.111.4
111.111.111.3 E
333.333.333.3
LAN1
LAN3
C D
5
LAN2
ARP
A->E, empty ARP tables
A checks routing table for an entry that matches E (probably finds a
default gateway that it sends everything to leaving the network
111.111.111/24; its routing table says that next_hop =
111.111.111.4
A broadcasts ARP request asking “who has IP address
111.111.111.4?”
R1 responds (more specifically, Ethernet adaptor on R1): I have IP
address 111.111.111.4, and my MAC address is X; A enters this
information into its ARP table
A sends the IP packet in an Ethernet frame with src=MAC_A, dst = X
R1's adaptor on network 111.111.111/24 receives frame,
decapsulates, checks its routing table to determine that next hop is
222.222.222.4, finds interface connected to it, and hands packet to
adaptor for 222.222.222/24
This adaptor repeats same process as above, etc.
If ARP tables are already populated, the broadcast steps do not
happen
6
CSMA/CD in Ethernet
Given:
Two nodes A and B on the same Ethernet segment
Propagation delay 225 bit times (bit-time = 1 bit/10Mbps)
Suppose A sends a frame; before the first bit of that frame
reaches B, B starts sending a frame as well
Question:
Is it possible that A finishes transmitting its frame before it
detects that B is transmitting as well?
Note:
If this happens, it would mean that A erroneously assumes
that its frame got through, although it did not
Minimum frame size is 512+64=576 bits
7
CSMA/CD in Ethernet
Worst-case assumptions:
A B A and B are at different
extremities of cable
Start xmit A Transmission at B starts
right before A's
transmission arrives at B
Then:
Start xmit B
B's transmission arrives at
A at the latest at 2RTT =
450 bit-times; therefore,
Ethernet minimum frame
A still transmitting -> size ensures that A's
collision detected transmission is still going
on, i.e., A detects collision
Any other node between A
and B also detects collision
8