Documente Academic
Documente Profesional
Documente Cultură
15-441 Computer
p Networkingg
z Framing: encapsulating a network layer
Lecture 6 datagram into a bit stream.
Data link Layer – Access Control z
» Add header, mark and detect frame boundaries, …
Error control: error detection and correction
to deal with bit errors.
» May also include other reliability support, e.g.
retransmission
t i i
z Flow control: avoid sender overrunning
receiver.
z Media access: controlling which frame should
be sent over the link next.
» Easy for point-to-point links
» Harder for multi-access links: who gets to send?
Based on slides by Peter Steenkiste
Copyright ©, Carnegie Mellon 2007-10 1 2
Lecture 6 15 441 © 2008 2
So far … So far …
• … But what if we want more nodes? • … But what if we want more nodes?
P-2-p
P 2p shared
3 switches 4
Lecture 6 15 441 © 2008 3 Lecture 6 15 441 © 2008 4
Datalink Architectures Media Access Control
5 6
Lecture 6 15 441 © 2008 6
7 8
Lecture 6 15 441 © 2008 7 Lecture 6 15 441 © 2008 8
A Switch
Switch-based
based Network Switch Architecture
z Switches are connected by point-point links.
z Packets come in one
z Packets are forwarded hop
hop-by-hop
by hop by the i t f
interface, forwarded
f d d to
t output
t t Control
switches towards the destination. interface based on address. Processor
» Forwarding is based on the address » Same idea for bridges, switches,
routers: address look up differs Input
p Output
p
z How does a switch
Ho s itch work?
ork? Port Port
z How do nodes exchange packets over a link? Output Input
Port Port
z How is the destination addressed? z Control processor manages Switch
the switch and executes Fabric
Point-Point higher level protocols. Output Output
Switch link Port Port
» E.g. routing, management, ...
PCs at Input Input
Work PC at z The switch
Th it h fabric
f b i directs
di t the
th P t
Port P t
Port
Home traffic to the right output port.
z The input and output ports
deal with
ith transmission and
reception of packets.
9 10
Lecture 6 15 441 © 2008 9 Lecture 6 15 441 © 2008 10
Destination Port
A 3
B 0
C
D
11 E 12
Lecture 6 15 441 © 2008 11 Lecture 6 F 15 441 © 2008 12
Virtual Circuit Switching Setup assign VCIs
Setup,
z Two stage process
»Setup connection (create VCIs)
»Send packets
p
13 14
Lecture 6 15 441 © 2008 13
Packet Forwarding:
Address Lookup Datalink Classification
Switch
Datalink
A
Address Next Hop Info
f
z Address from header. Virtual Packet Scheduled Random
B31123812508 3 13 Circuits Switching Access Access
» Absolute address (e.g. Ethernet)
38913C3C2137 3 - » (IP address for routers)
» (VC identifier, e.g. ATM))
ATM,
ATM Bridged
B id d Token
T k ring,
i Eh
Ethernet,
A21023C90590 0 - framerelay LANs FDDI, 802.11 802.11, Aloha
z Next hop: output port for packet.
z Info: priority,
priority VC id,
id ..
128.2.15.3 1 (2,34) z Table is filled in by protocol.
15 16
Lecture 6 15 441 © 2008 16
Problem: Sharing a Wire Listen and Talk
Learned ho
how to connect hosts yak yak…
17 18 18
19 19 20 20
Problem: Who is this packet for? Outline
z Aloha
z N d to
Need t putt an address
dd on the
th packet
k t
z What should it look like?
z Ethernet MAC
z How do you determine your own address?
z How do you know what address you want to send it z Collisions
to?
z Ethernet Frames
21 21 22 22
Outline Ethernet
z First practical local area network, built at
X
Xerox PARC ini 70’s
70’
z Aloha
z “Dominant” LAN technology:
» Cheap
Ch
z Ethernet MAC » Kept up with speed race: 10, 100, 1000 Mbps
z Ethernet Frames
27 27 28 28
Ethernet MAC – Collision
Ethernet MAC – Carrier Sense D t ti
Detection
z Basic idea: z But: ALOHA has collision detection also?
» Listen to wire before
Hidden Exposed » That was very slow and inefficient
transmission
» Avoid collision with St Louis
St.Louis z Basic idea:
NY
active transmission » Listen while transmitting
z Whyy didn’t ALOHA Chicago
C cago
» If you notice interference Æ assume collision
have this? CMU
CMU z Why didn’t ALOHA have this?
» In wireless, relevant » Very difficult for radios to listen and transmit
contention at the Chi
Chicago » Signal strength is reduced by distance for radio
receiver, not sender NY
– Much easier to hear “local, powerful” radio station
– Hidden terminal than one in NY
– Exposed terminal – You may not notice any “interference”
29 29 30 30
Ethernet CSMA/CD:
Ethernet MAC (CSMA/CD) Making it word
z Carrier Sense Multiple
p Access/Collision Jam Signal:
g make sure all other transmitters
Detection are aware of collision; 48 bits;
Packet? Exponential Backoff:
No
z If deterministic delay after collision,
Sense Send Detect collision will occur again in lockstep
Carrier Collision
z Why not random delay with fixed mean?
Yes
Discard » Few senders Æ needless waiting
Packet Jam channel
b=CalcBackoff();
» Too
T many senders
d Æ too
t many collisions
lli i
attempts < 16
wait(b); z Goal: adapt retransmission attempts to
attempts++;
attempts == 16
estimated current load
» heavy load: random wait will be longer
31 31 32 32
Ethernet Backoff Calculation Outline
33 33 34 34
35 35 36 36
Ethernet Collision Detect End to End Delay
z c in cable = 60% * c in vacuum = 1.8 x 10^8
z Min packet length > 2x max prop delay m/s
»If A, B are at opposite sides of link, z Modern 10Mb Ethernet
and B starts one link prop delay after » 2.5km, 10Mbps
A » ~= 12.5us delay
z Jam network for 32-48 bits after collision, » +Introduced repeaters (max 5 segments)
then stop sending » Worst case – 51.2us round trip time!
»Ensures
E that
th t everyone notices
ti z Slot time = 51.2us = 512bits in flight
collision
» After this amount, sender is guaranteed sole
access to link
37 37 » 51.2us = slot time for backoff 38 38
» Original 3Mbit Ethernet did not have minimum z Minimum packet size requirement
packet size » Make network smaller Æ solution for 100BaseT
43 43 44 44
Ethernet Frame Structure (cont.)
(cont ) Addressing Alternatives
z Broadcast Æ all nodes receive all packets
p
z Each protocol layer needs to provide
» Addressing determines which packets are kept and
some hooks to upper layer protocols which are packets are thrown away
» Demultiplexing: identify which upper layer » Packets
P k t can b be sentt tto:
protocol packet belongs to – Unicast – one destination
» E.g.,
g , port
p numbers allow TCP/UDP to identify
y – Multicast – group of nodes (e.g. “everyone playing Quake”)
target application – Broadcast – everybody on wire
EXTRA SLIDES
53 54 54
61 61 62