forwarding and addressing in the link layer
TRANSCRIPT
![Page 1: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/1.jpg)
Forwarding and Addressing in the Link Layer
3035/GZ01 Networked Systems Kyle Jamieson Lecture 4
Department of Computer Science
University College London
![Page 2: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/2.jpg)
The link layer
Link layer Link layerLink layer
link_send(packet, link-id)
Node A Node B
Node C
network_handle
Link layer
Node D
Serial
Wireless
Ethernet
Datagram
The link layer (L2) has the job of transferring a datagram point-‐to-‐point over a link
Unit of data is called a frame at the link layer
![Page 3: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/3.jpg)
• In each and every host • Network adapter
– Physical card – Chip in a device – APaches to host’s system bus
• Implemented both in hardware and soRware
– SoRware: device driver running on CPU – Hardware: FPGA, ASIC in network adapter
Where is the link layer implemented?
PHY
Controller
CPU Memory
Host ApplicaYon Transport Network Link
Link Physical
Network adapter
![Page 4: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/4.jpg)
Hardware or so<ware? • SoRware is more flexible,
unless you need:
1. Time-‐criYcal funcYonality – Backoff transmission Yming in Ethernet
2. Highly parallel processing – Dot product computaYons for CDMA, filtering for the PHY
PHY
Controller
CPU Memory
Host ApplicaYon Transport Network Link
Link Physical
Network adapter
![Page 5: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/5.jpg)
Today
1. Framing – Byte-‐oriented framing – Bit-‐oriented framing
2. Link layer addressing 3. Link layer switching and forwarding
![Page 6: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/6.jpg)
Framing: The problem
Time
1 0 0 0 1 11
Binary encoding
Manchester encoding
Bit stream 0 0
• We have seen how to encode bits on a link – Ethernet: Manchester encoding, synchronizaYon on edges – Result in general: An infinite stream of bits
• Problem: where does each frame begin and end?
![Page 7: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/7.jpg)
Byte-‐oriented framing • Treat each frame as a collecYon of bytes rather than bits • Byte-‐oriented framing link layer protocols:
– PPP (point-‐to-‐point protocol), used to carry Internet Protocol (IP) packets over dialup lines, Virtual Private Networks
– BISYNC (IBM, 60’s), Digital Data CommunicaYon Message Protocol (DDCMP), Digital Equipment CorporaYon’s DECNET
• BISYNC uses sen/nel characters to frame:
• SYN: Beginning of frame • SOH: Start of header • STX: Start of text (packet data) • ETX: End of text • What if senYnel occurs in data? Character stuffing: insert escape
character DLE before senYnel • What if escape character occurs in data? Escape the escape character
![Page 8: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/8.jpg)
PPP byte stuffing
• At the sender: – Stuff escape byte before each flag byte in payload – Stuff escape byte before each escape byte in payload
• At the receiver: – Escape, flag byte à discard escape byte, keep flag byte, conYnue data recepYon
– Single flag byte: interpret as the flag byte – Two escape bytes à discard one
• Like BISYNC, PPP takes a senYnel-‐based approach
![Page 9: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/9.jpg)
Byte-‐counHng approach: DDCMP
• Byte-‐coun/ng framing: Include number of bytes in header (Count field):
• What if Count field is corrupted? – Will frame the wrong bytes – This is called a framing error – With high probability, CRC will detect the framing error and discard the frame
• Do we sYll need to escape the SYNs?
![Page 10: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/10.jpg)
Bit-‐oriented framing • Main idea: View link as stream of bits instead of bytes • Example: High-‐Level Data Link Control (HDLC), used in Cisco routers and
the V.42 standard for telephone modems • Choose some paPern of bits as a senYnel e.g.: 1111111 • Bit stuffing algorithm: Modify the outgoing data stream as follows: • At sender: 111111 → 1111110 • At receiver: 1111110 → 111111
1111111 → (end of frame) • Size of frame depends on data it contains! • Not guaranteed free of framing errors
Six 1s Six 1s
Seven 1s
Seven 1s
![Page 11: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/11.jpg)
Today
1. Framing 2. Link layer addressing 3. Link layer switching and forwarding 4. Virtualizing links
![Page 12: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/12.jpg)
Comparing addressing schemes • Network layer address (IP address)
– FuncYon: move datagram to desYnaYon network – 32-‐bit address, doPed quad notaYon a.b.c.d where each component is an eight-‐bit unsigned integer
– Hierarchical address space
• Link layer address (MAC address, Ethernet address): – FuncYon: move frame from one point to another point on the same network
– 48-‐bit address (in most LANs) – Burned in NIC ROM, also someYmes soRware sePable – Usually a flat address space
![Page 13: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/13.jpg)
Link-‐layer addressing • Each adapter on LAN has unique link layer address,
my_station_id!• Special broadcast address broadcast_id!
17 24 12 05 19
StationIdentifier(EthernetAddress)
• Each L3 protocol registers itself in net_handler array • L2 address-‐related funcYonality for inbound frames:
• Test received_frame.destination against my_station_id or broadcast_id, drop if neither match
• handler ß net_handler!!! ! ! ! ![received_frame.net_protocol]!
• call handler(received_frame.payload)!
![Page 14: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/14.jpg)
Mapping network to link addresses
• Goal: Translate from nework_send(data, length, IP, N) to link_send(data, length, IP, enet/18)!
• Name-‐mapping table: example of soR state
upper-layer network address
Ethernet station identifier
link identifier
Ethernet
serverrouterwork
station
work
stationwork
station
work
station
1 61111
17 18 14 22 1915
L M N P Q K
1
…2
34
5
G
H
J
E
F
address
Ethernet/
N
P
Q
K
E
enet/18
enet/14
enet/22
enet/19
enet/19
M enet/15
station
internet
![Page 15: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/15.jpg)
Link layer addresses aren’t routable
• Network layer routes from one network to another
upper-layer network address
Ethernet station identifier
link identifier
Ethernet
serverrouterwork
station
work
stationwork
station
work
station
1 61111
17 18 14 22 1915
L M N P Q K
1
…2
34
5
G
H
J
E
F
(link layer address)
![Page 16: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/16.jpg)
The Address ResoluHon Protocol (ARP)
L sending a datagram to N: L: network_send(data, length, IP, N)!L: link_send(“where is N?”, length, ARP,
broadcast_id)!N: link_send(“N is at enet/18”, length, ARP, enet/17)!L: link_send(data, length, IP, enet/18)!
upper-layer network address
Ethernet station identifier
link identifier
Ethernet
serverrouterwork
station
work
stationwork
station
work
station
1 61111
17 18 14 22 1915
L M N P Q K
1
…2
34
5
G
H
J
E
F
Internet Address
enet/ station
ARP table at L:
TTL
N 18 20 min
![Page 17: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/17.jpg)
ARP’s role in L3 rouHng
work
station
1
router
4
6
work
station
1
server
Ethernet Ethernet
17
L N K E
1918
27
28
• Walkthrough: send IP data from L to E via router K • Router K
• Two ARP tables: one for each subnet • Two interfaces (interface ids 6, 4): one for each subnet, with two link-‐layer addresses (19, 27)
![Page 18: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/18.jpg)
Example: rouHng between subnets
work
station
1
router
4
6
work
station
1
server
Ethernet Ethernet
17
L N K E
1918
27
28
L sending a datagram to E: L: network_send(data, length, IP, E)!L: link_send(data, length, IP, enet/28)!L: ARPs for K’s link layer address (enet/19) L: link_send(data, length, IP, enet/19)!K: ARPs for E’s link layer address (enet/28) on link/4 K: link_send(link/4, data, length, IP, enet/28)!
![Page 19: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/19.jpg)
Hubs
• ReplicaYng device: bits coming in go out all ports – Operates at the physical layer (L1)
• Doesn’t run CSMA/CD: immediately replicates bits • Collisions possible between all hosts • No frame buffering at the hub • Physical limitaYons: can’t grow collision domain too big
Hub
![Page 20: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/20.jpg)
Today
1. Framing 2. Link layer addressing 3. Link layer switching and forwarding
– Learning switches – Spanning Tree Protocol – Virtual LANs
![Page 21: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/21.jpg)
Ethernet nowadays: Switched
• Hosts have dedicated, direct connecYon to switch
• Switches buffer frames
• Ethernet protocol used on each incoming link, but no collisions – Each link in own collision domain
• Switching: Allows two conversaYons A → A’ and B → B’ simultaneously, without collisions
A
D
B
E
C
F
1 2 3
4 5 6 Switch S
![Page 22: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/22.jpg)
The switch table
• How to tell which port to forward packet?
• The switch table: LAN addr Port Time-‐to-‐live
• Switch table iniYally empty
• How to build up switch table entries?
A
D
B
E
C
F
1 2 3
4 5 6
23
21 26
25 24
22
Switch S
![Page 23: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/23.jpg)
Building the switch table: Self-‐learning
• Switch table: entries of (LAN address, port id, Yme-‐to-‐live)
• Learning algorithm: on receiving a packet from LAN address S to LAN address D: 1. Add S to switch table with incident port id 2. If D is broadcast_id: forward out all ports 3. If D is in switch table, lookup entry and forward to
resulYng port id. Otherwise, forward out all ports
• Periodically flush link table entries based on Yme-‐to-‐live
![Page 24: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/24.jpg)
Building up the switch table: example
1. Aà S: [A (enet/21) à D (enet/24)] S à (all ports)
2. B à S: [B (enet/22) à C (enet/23)] S à (all ports)
3. D à S: [D (enet/24) à B (enet/22)] S à port 2 only
Switch table: LAN addr Port TTL enet/21 1 20 min enet/22 2 20 min enet/24 4 20 min
A
D
B
E
C
F
1 2 3
4 5 6
23
21 26
25 24
22
Switch S
![Page 25: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/25.jpg)
Aside: What is a hub?
Hub • Differences
– Physical layer (L1) device – ReplicaYng device: bits in one
port go out all ports – No medium access control – No frame buffering
• CommonaliYes – Hosts are unaware of
presence of hubs – No configuraYon needed
Switch
– Link-‐layer (L2) device – SelecYvely forward frame to
one or more outgoing links – CSMA/CD MAC – Buffers frames
– Hosts are unaware of presence of switches
– No configuraYon needed
![Page 26: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/26.jpg)
InterconnecHng LANs
A
B
S1
C D
E F
S2
S4
S3
1 2
2 3 4 2
3
11
12 13
21 3
22 23
Link layer addresses
1
4
1 1
• Switches can connect LANs as well as hosts • SomeYmes called bridges in this context
• The enYrety is called an extended LAN
![Page 27: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/27.jpg)
InterconnecHng LANs: example Suppose C sends frame to F, F responds to C
A
B
S1
C D
E F
S2
S4
S3
1 2
2 3 4 2
3
11
12 13
21 3
22 23
Link layer addresses
1
4
1 1
Address Port 13 4
![Page 28: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/28.jpg)
InterconnecHng LANs: example Suppose C sends frame to F, F responds to C
A
B
S1
C D
E F
S2
S4
S3
1 2
2 3 4 2
3
11
12 13
21 3
22 23
1
4
1 1
Address Port 13 4
Address Port 13 1
![Page 29: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/29.jpg)
InterconnecHng LANs: example Suppose C sends frame to F, F responds to C
A
B
S1
C D
E F
S2
S4
S3
1 2
2 3 4 2
3
11
12 13
21 3
22 23
1
4
1 1
Address Port 13 4
Address Port 13 1
Address Port 13 1
Address Port 13 1
![Page 30: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/30.jpg)
InterconnecHng LANs: example Suppose C sends frame to F, F responds to C
A
B
S1
C D
E F
S2
S4
S3
1 2
2 3 4 2
3
11
12 13
21 3
22 23
1
4
1 1
Address Port 13 4 23 1
Address Port 13 1 23 2
Address Port 13 1 23 4
Address Port 13 1
![Page 31: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/31.jpg)
Problem: Forwarding loops
A
B
S1
C E F
S2
S4
S3
1 2
2 3 4 2
3
11
12 13 3
22 23
1
4
1 1
Address Port 13 4 23 1 22 1
Address Port 13 1 23 2 22 2
Address Port 13 1 23 4 22 3
Address Port 13 1
5
![Page 32: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/32.jpg)
Problem: Forwarding loops
A
B
S1
C E F
S2
S4
S3
1 2
2 3 4 2
3
11
12 13 3
22 23
1
4
1 1
Address Port 13 4 23 1 22 1
Address Port 13 1 23 2 22 2
Address Port 13 1 23 4 22 3 22 2
Address Port 13 1
5
![Page 33: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/33.jpg)
Problem: Forwarding loops
• Can’t learn the direcYon of a source if it’s in more than one direcYon, so bridge learning algorithm breaks
• Why might loops form? – Inadvertently: many people responsible for network, one person adds a bridge
• IntenYonally: more connecYons between bridges increases redundancy, helping to cope with failure – So we need to revise the bridge learning algorithm
![Page 34: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/34.jpg)
The spanning tree protocol (STP)
• Manager at DEC asked Radia Perlman to build a switch (bridge) to connect two Ethernets
• Perlman’s idea: Switches agree on a loop-‐free and connected spanning tree
• Implementers at DEC resisted (wanted simplest possible design), first customer site connected bridge to one Ethernet twice, generaYng a “broadcast storm”
• Once the spanning tree is formed:
– Switches block some ports from sending or receiving data – Switches conYnue using the learning switch algorithm to forward over the
spanning tree
![Page 35: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/35.jpg)
Spanning tree protocol (STP): Outline
1. Elect one root switch (switch with the lowest ID)
2. Compute shortest paths tree from root to each switch S – Note which port of S is on path to root: root port (R)
3. All switches connected to a LAN choose a designated switch to forward frames to root (switch on path to root from LAN)
– e.g. switch 2 is designated for the LAN below – i.e., each port decides if it is a designated port (D)
4. Block all other ports: blocked port (B)
A 1(D) 1(R) 2 3
Port number
Switch ID Switch Ethernet LAN LAN ID
![Page 36: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/36.jpg)
STP: Messages and switch state
• All switches exchange configuraHon messages switch X sends: (Root idenYfier, distance to root, X)
– ConfiguraYon messages are never blocked – Switch X generates configuraYon messages periodically with a
“clock Yck” Ymer, iniYally sending (X, 0, X)
• State at each switch X: 1. Root idenYfier (iniYally X) 2. ConfiguraYon message to send (iniYally (X, 0, X)) 3. State at each port:
a) Forwarding data traffic or blocking data traffic (iniYally forwarding)
b) “Best” configuraYon message + age of that message (iniYally empty)
![Page 37: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/37.jpg)
ElecHng a per-‐LAN designated switch
• Designated port rule: At a switch, for each port p – Consider all configuraYon messages received on port p and the configuraYon message the switch would send
– If receive “bePer” configuraYon message on a port p, don’t send configuraYon messages on port p, otherwise p is designated: send your configuraYon message on p
• Rule for comparing configuraYon messages: (R1, d1, X1) beCer than (R2, d2, X2) if R1 < R2 or (R1 = R2 and d1 < d2) or (R1 = R2 and d1 = d2 and X1 < X2)
![Page 38: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/38.jpg)
Comparing configuraHon messages
• Example: Switch 2 sends (2, 0, 2); 3 sends (3, 0, 3) • Message (2, 0, 2) is bePer than (3, 0, 3)
– Subsequently, switch 2, port 1 sends configuraYon messages periodically
– Subsequently, switch 3, port 1 does not send configuraYon messages
1(D) 2 3
1
![Page 39: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/39.jpg)
STP: iniHal startup phase
Switch 5 Root Dist Transmi[er
Port 1 2 0 2
Port 2 2 0 2
Port 3 5 0 5
• IniHally, X generates configuraYon messages periodically, sending (X, 0, X)
• All ports designated and forwarding • Result: For each LAN, one aPached switch
(the designated switch) transmits configuraYon messages
A C
G
B
F
2
2
D 90
66 5
101 2
87 E
78
3 4
5 1
1
1 2
1(D) (78,0,78)
2(D) (78,0,78) 1(D) (66,0,66)
2
1(D) (87,0,87)
2
3(D) (5,0,5)
1(D) (2,0,2)
2(D) (2,0,2)
![Page 40: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/40.jpg)
CalculaHng root ID and cost to root
• Switches conYnuously take the following steps:
1. Root ID rule: Root ID r at switch X is the minimum of X and root IDs received at all ports
2. Calculate distance to root d at switch X: – If X is the root (X = r), d = 0 – Otherwise, X is not the root (X ≠ r):
• d = one plus the minimum cost from configuraYon messages received on all ports (transmiPer field breaks Yes). Suppose this comes from port p.
• Root port rule: Designate port p as a root port
3. Switch X’s configuraYon message is now (r, d, X). Reapply designated port rule on all ports
4. Blocked port rule: Don’t forward data to or from a port if it is not a designated port or a root port
![Page 41: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/41.jpg)
STP: building the tree
A C
G
B
F
D 90
66 5
101 2
87 E
78
(2,0,2) 2(D)
Switch 5 Root Dist Transmi[er Port 1 2 0 2 Port 2 2 0 2 Port 3 2 1 5
• On LANs A & B, 5 hears (2, 0, 2) • 5’s root ID r: 2, d = 1 (port breaks Ye) • 5’s new message: (2, 1, 5)
3(D) (2,1,5)
1(D) (2,0,2)
2(B) 1(R)
1(D) (78,0,78)
2(D) (78,0,78) (66,0,66)
1(D)
1(D) (87,0,87)
![Page 42: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/42.jpg)
STP: building the tree
A C
G
B
F
D 90
66 5
101 2
87 E
78
(2,0,2) 2(D)
Switch 66 Root Dist Transmi[er Port 1 2 1 66 Port 2 2 0 2
• On LAN A , 66 hears (2, 0, 2) • 66’s root ID r: 2, d = 1 • 66’s new message: (2, 1, 66)
3(D) (2,1,5)
1(D) (2,0,2)
2(B) 1(R)
1(D) (78,0,78)
2(D) (78,0,78) (2,1,66)
1(D)
1(D) (87,0,87)
2(R)
![Page 43: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/43.jpg)
STP: building the tree
A C
G
B
F
D 90
66 5
101 2
87 E
78
(2,0,2) 2(D)
Switch 101 Root Dist Transmi[er Port 1 2 1 5 Port 2 2 2 101
• On LAN C, 101 hears (2, 1, 5) • 101’s root ID r: 2, d = 2 • 101’s new message: (2, 2, 101)
3(D) (2,1,5)
1(D) (2,0,2)
2(B) 1(R)
1(D) (78,0,78)
2(D) (78,0,78) (2,1,66)
1(D)
1(D) (87,0,87)
2(R)
1(R) 2(D) (2,2,101)
![Page 44: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/44.jpg)
STP: building the tree
Switch 90 Root Dist Transmi[er Port 1 2 1 66 Port 2 2 0 2 Port 3 2 1 5 Port 4 2 1 90 Port 5 2 1 90
A C
G
B
2(R) D 90
66 5
101 2 (2,0,2) 2(D)
3(B)
4(D) (2,1,90) 1(B)
1(R) 2(B)
(2,1,66) 1(D)
2(R)
3(D) (2,1,5)
1(D) (2,0,2)
2(B) 1(R)
(2,2,101)
• On LAN A , 90 hears (2, 0, 2) • 90’s root ID r: 2, d = 1 • 90’s new message: (2, 1, 90)
F 87
E 78
(2,1,90) 5(D)
(2,2,78) 1(D)
2(R)
![Page 45: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/45.jpg)
STP: building the tree
Switch 87 Root Dist Transmi[er Port 1 2 1 66 Port 2 2 0 2
A C
G
B
2(R) D 90
66 5
101 2 (2,0,2) 2(D)
3(B)
4(D) (2,1,90) 1(B)
1(R) 2(B)
(2,1,66) 1(D)
2(R)
3(D) (2,1,5)
1(D) (2,0,2)
2(B) 1(R)
(2,2,101)
• On LAN F , 87 hears (2, 1, 90) • 87’s root ID r: 2, d = 2 • 87’s new message: (2, 2, 87)
F 87
E 78
(2,1,90) 5(D)
(2,2,78) 1(D)
2(R)
(2,2,87)
1(R) 2(B)
![Page 46: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/46.jpg)
STP: Handling topology changes
• ConfiguraYon messages also contain age: (r, d, X, age) – age = 0 when sending configuraYon message
• Best configuraYon message for each port contains age – Age incremented each unit of Yme – If age reaches some threshold (max age), discard that configuraYon message and recalculate using all rules
• Recalculate when: 1. Receive bePer or newer configuraYon message on port p:
overwrite exisYng configuraYon message 2. Timer Ycks: increment message age in stored messages for
each port
![Page 47: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/47.jpg)
STP: Handling failures
Switch 90 Root Dist Transmi[er Port 1 2 2 1 1 66 90 Port 2 2 0 2 Port 3 2 1 5 Port 4 2 1 90 Port 5 2 1 90
2(R)
90
66 5
101 2
87 78
(2,0,2) 2(D)
3(B) 4(D) (2,1,90)
(2,1,90) 5(D)
1(D) (2,1,90)
1(R) 2(B)
(2,2,78) 1(D)
2(R)
2(R)
1(R) 2(B)
90’s root ID r: 2, d = 1 90’s message: (2, 1, 90)
3(D) (2,1,5)
1(D) (2,0,2)
2(B) 1(R)
![Page 48: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/48.jpg)
STP: Handling new bridges
• Don’t want loops, even for short periods of Yme • Switches 2, 5, 101 send messages immediately, with current age in table • On power-‐up, switch puts its ports in new pre-‐forwarding state: sends
configuraYon messages as if designated, but doesn’t forward data
2(R)
90
66 5
101 2
87 78
(2,0,2) 2(D)
3(B) 4(D) (2,1,90)
(2,1,90) 5(D)
1(D) (2,1,90)
1(R) 2(B)
(2,2,78) 1(D)
2(R)
2(R)
RP 2(B)
3(D) (2,1,5)
1(D) (2,0,2)
2(B) 1(R)
95 (95,0,95)
1(D)
(95,0,95) 2(D)
![Page 49: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/49.jpg)
The problem with extended LANs • Switched LANs afford greater scalability, but extended LANs
do not isolate traffic – Broadcast frames traverse the enYre extended LAN
• Two consequences: 1. Broadcast traffic does not scale, reducing overall
performance 2. Allows eavesdropping across LANs • Therefore, extended LANs don’t scale
![Page 50: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/50.jpg)
Virtual LANs (VLANs)
• Idea: The switch assigns each port a color, an idenYfier designaYng the VLAN that port belongs to
• Traffic isolaYon: colors = broadcast domains
• Easily reconfigurable port assignments
• RouYng between VLANs: layer 3 rouYng funcYonality
1 9 15 2 4 8 10 16
… … Computer Science Electrical Engineering
![Page 51: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/51.jpg)
VLAN example • Configure ports on W, X, Y,
and Z to be in appropriate VLANs – Trunk ports between B1 and B2
configured for both VLANs
• Bridge inserts VLAN header containing color between Ethernet header and payload
• If a packet contains a VLAN header, bridges only forward on matching-‐color or trunk ports
Trunk link
![Page 52: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/52.jpg)
Why can’t Ethernet replace IP? • L2 is point-‐to-‐point, L3 has source and desYnaYon
• Then Ethernet came, world got confused and thought Ethernet was a compeYtor to L3
• Perlman: “Should have been called ‘Etherlink.’”
• So, why can’t Ethernet replace IP? 1. Flat addresses 2. No hop count (loops would be a disaster) 3. No fragmentaYon, reassembly, for heterogeneous networks
![Page 53: Forwarding and Addressing in the Link Layer](https://reader038.vdocuments.net/reader038/viewer/2022102812/589eca4a1a28ab814a8bec72/html5/thumbnails/53.jpg)
NEXT TIME
MulH-‐hop Networks and End-‐to-‐end Arguments Pre-‐Reading: End-‐to-‐end Arguments in System Design