View
215
Download
0
Embed Size (px)
Citation preview
Lecture 4, 20-755: The Internet, Summer 1999 1
20-755: The InternetLecture 4: Internetworking I
David O’Hallaron
School of Computer Science and
Department of Electrical and Computer Engineering
Carnegie Mellon University
Institute for eCommerce, Summer 1999
Lecture 4, 20-755: The Internet, Summer 1999 2
Today’s lecture
• Connecting computers (50 min)
• Break (10 min)
• Connecting networks (50 min)
Lecture 4, 20-755: The Internet, Summer 1999 3
Typical computer system
Local/IO BusLocal/IO Bus
MemoryMemory Networkadapter
Networkadapter
IDE diskcontroller
IDE diskcontroller
Videoadapter
Videoadapter
DisplayDisplay NetworkNetwork
ProcessorProcessor Interruptcontroller
Interruptcontroller
SCSIcontroller
SCSIcontroller
SCSI busSCSI bus
Serial port controller
Serial port controller
Parallel portcontroller
Parallel portcontroller
Keyboardcontroller
Keyboardcontroller
KeyboardKeyboard MouseMouse PrinterPrinterModemModem
disk
disk cdrom
Lecture 4, 20-755: The Internet, Summer 1999 4
Simple example
Starting Point: Want to send bits between 2 computers• FIFO (First-in First-out) queue (buffer) on each end
• Can send both ways (“full duplex”)
• Name for standard group of bits sent: “packet”
• Packet format and rules for communicating them (“protocol”)
Simple request/response protocol and packet format:
0/1 data/address
0: please send the data word at “address”1: here is the data word you asked for.
header payload
Lecture 4, 20-755: The Internet, Summer 1999 5
Questions about simple example• What if more than 2 computers want to communicate?
– Need an interconnect? Need computer address field in packet?
• What if the machines are far away?– WAN vs LAN
• How do multiple machines share the interconnect?– multiple paths? arbitration? congestion control?
• What if a packet is garbled in transit?– Add error detection field in packet?
• What if a packet is lost?– More elaborate protocols to detect loss?
• What if multiple processes per machine?– one queue per process? separate field in packet to identify process?
• Warning: You are entering a buzzword-rich environment!!!
Lecture 4, 20-755: The Internet, Summer 1999 6
Generic network
softwaresoftware
hardwarehardware
Interconnect (wires, repeaters, bridges, etc)Interconnect (wires, repeaters, bridges, etc)
softwaresoftware
hardwarehardware
softwaresoftware
hardwarehardware
link link link
host host host
protocol stack
network adapter/interface card
OS code
Lecture 4, 20-755: The Internet, Summer 1999 7
Protocols• A protocol defines the format of packets and the rules
for communicating them across the network.
• Different protocols provide different levels of service:– simple error correction (ethernet)
– uniform name space, unreliable best-effort datagrams (host-host) (IP)
– reliable byte streams (TCP)
– unreliable best-effort datagrams (process-process) (UDP)
– multimedia data retrieval (HTTP)
• Crucial idea: protocols leverage off of the capabilities of other protocols.
Lecture 4, 20-755: The Internet, Summer 1999 8
Protocol layering
Protocols provide specialized services by relying on services provided by lower-level protocols (I.e., they leverage lower-level services).
Reliable byte streamdelivery(process-process)
Unreliablebest effort datagramdelivery(host-host)
Unreliablebest effortdatagramdelivery(process-process)
User application program (FTP, Telnet, WWW, email)User application program (FTP, Telnet, WWW, email)
User datagram protocol(UDP)
User datagram protocol(UDP)
Transmission control protocol (TCP)
Transmission control protocol (TCP)
Internet Protocol (IP)Internet Protocol (IP)
Network interface (ethernet)Network interface (ethernet)
hardwarehardware Physical connection
interface between user code and OS code(Application program interface (API))
Lecture 4, 20-755: The Internet, Summer 1999 9
Encapsulation
TCP segment header
TCP segment header datadata
datadata
Ethernet frameheader
Ethernet frameheader
IP datagramheader
IP datagramheader
TCP segment header
TCP segment header datadata
IP datagramheader
IP datagramheader
TCP segment header
TCP segment header datadata
Application program
TCP
IP
Adapter
Network
OS code
User codeUser Interface (API)
OS/adapter interface(exception mechanism)
Adapter/Network interface
Lecture 4, 20-755: The Internet, Summer 1999 10
Basic network types
• System area net (SAN)– same room (meters)
– 300 MB/s Cray T3E
• Local area network (LAN)– same bldg or campus
(kilometers)
– 10 Mb/sEthernet
– 100 Mb/s Fast Ethernet
– 100 Mb/s FDDI
– 150 Mb/s OC-3 ATM
– 622 Mb/s OC-12 ATM
• Metropolitan area network (MAN)
– same city (10’s of kilometers)
– 800 Mb/s Gigabit Nectar
• Wide area network (WAN)– nationwide or worldwide
(1000’s of kilometers)
– telephone system
» AT&T, MCI, Sprint
– 1.544 Mb/s T1 carrier
– 44.736 Mb/s T3 carrier
Lecture 4, 20-755: The Internet, Summer 1999 11
Examples of transmission media
2 insulated copper wires
twisted pair:twisted pair: (1-2 Mb/s at 1 km)
stiff copper wire
insulator
braided outer conductor
plastic cover
coaxial cable:coaxial cable: (1-2 Gb/s at 1 km)
silicalight source
fiber:fiber: (100-200 Gb/s at 1 km)
station wagon full of mag tapes hurtling down the highway every hour:
station wagon full of mag tapes hurtling down the highway every hour:
(15 Gb/s at 1 hour)
7 GBytes/tape1000 tapes/station wagon (50x50x50cm)7,000 GBytes total7,000 GBytes/3600 seconds = 15 Gb/s
$5/tape reused 10 times -> $500 tape cost$200 for shipping ->10 cents /GByte
Lecture 4, 20-755: The Internet, Summer 1999 12
Shared vs switched mediaShared media (e.g., Ethernet) Switched media (e.g., ATM)
bb
ccaa
ddswitch
aa ccbb dd
aa ccbb ddbb
ccaa
ddswitch
aa ccbb dd
aa ccbb dd
output portsinput ports
Lecture 4, 20-755: The Internet, Summer 1999 13
Network performance measures• Link bandwidth
– throughput measure expressed as rate
» MB/s = 220 bytes/sec» Mb/s = 106 bits/sec
– transfer rate across link
• Bisection bandwidth– smallest achievable
throughput if network is cut in half
• Latency– elapsed time (s, ms, etc) – time to cross network
• Overhead– another latency measure– time to snd/rcv first byte.
Lecture 4, 20-755: The Internet, Summer 1999 14
Example performance measures
Interconnect SAN LAN WAN
Example CM-5 Ethernet ATM
Bisection BW N x 5MB/s 1.125 MB/s N x 10 MB/s
Link BW 20 MB/s 1.125 MB/s 10 MB/s
Latency 5 µsec 15 µsec 50 to 10,000 µs
HW Overhead to/from 0.5/0.5 µs 6/6 µs 6/6 µs
SW Overhead to/from 1.6/12.4 µs 200/241 µs 207/360 µs (TCP/IP on
LAN/WAN)
N = number of hosts
Lecture 4, 20-755: The Internet, Summer 1999 15
AT&T Telephone Hierarchy
1
9876
5432
10
1 2 3 65 66 67
1 2 3 228 229 230
10 regional offices(fully interconnected)
67 sectional offices
230 primary offices
1,300 toll offices
19,000 end offices
200 million telephones
1 2 3 1298 1299 1300
local loopslocal loops
Source: Tannenbaum
Lecture 4, 20-755: The Internet, Summer 1999 16
Connecting distant computers with modems
codeccodec codeccodec
digital (short cable or bus)33 MB/s
digital (short cable or bus)33 MB/s
digital digital
28.8 Kb/sanaloglocal loop
1.544 Mb/s (T1 carrier) 28.8 Kb/sanaloglocal loop
local office
local office
tolloffice
homecomputer
homecomputer
ISPcomputer
ISPcomputer
V.34 modemV.34 modemV.34 modemV.34 modem
Lecture 4, 20-755: The Internet, Summer 1999 17
Modulating digital signals0 1 0 1 1 0 0 1 0 0 1 0
binary signaling
amplitude modulation
phase modulation
00 : no shift01: 1/4 shift left10: 1/2 shift left11: 3/4 shift left(shifts are relativeto previous wave)
sine wave carrier (1kHz-2kHz)
Lecture 4, 20-755: The Internet, Summer 1999 18
Quadrature amplitude modulation (QAM)
Modern modems use a combination of of amplitude and phase modulation toencode multiple bits per “symbol”, i.e. amplitude/phase pair.
3 bits/symbol QAM modulation(8 symbols)
phase angleis 1/4
4 bits/symbol QAM modulation(16 symbols)
1/8
Lecture 4, 20-755: The Internet, Summer 1999 19
Conventional Modems
MOdulate: convert from digital to analogDEModulate: convert from analog to digital
modem standards:
type symbols/sec bits/symbol Kb/s
v.32 2400 4 9.6v.32.bis 2400 6 14.4v.34 3200 9 28.8
modem standards:
type symbols/sec bits/symbol Kb/s
v.32 2400 4 9.6v.32.bis 2400 6 14.4v.34 3200 9 28.8
Theoretical limit for modulated signals is approx 35 Kb/s:
Shannon's law: max bits/s = H log2(1 + S/N), where H is bandwidthand S/N is signal to noise ratio. For phone network, H~3,600 bpsand 10 log10 (S/N) = 30 dB. Thus max rate is ~35 Kb/s.
Lecture 4, 20-755: The Internet, Summer 1999 20
T1 carrier (1.544 Mb/s)
Digital part of phone system based on the T1 carrier:
193 bit frame (125 us, 8000 samples/s, 8 bits/sample/channel)
channel 1 channel 2 channel 3 channel 24
8 data bitsper channelbit 1 is a
framing code
Each channel has a data rateof 8000 samples/s * 8 bits/channel = 64 Kb/s
Lecture 4, 20-755: The Internet, Summer 1999 21
56KB “Modems”
– Asymmetric: home to SP uses conventional v.34 modem
– SP has digital connection into phone system
» Channel sending 8000 samples / second, up to 8-bits/sample
– DAC encodes each sample with 92 or 128 voltage levels
» Not enough precision on analog side to handle finer resolution
– Receiver converts samples back to digital values
» Must match frequency & phase of senders DAC
» Establish using “training” signals from sender
digital (short cable or bus)
DACDAC
digital digital
Analog Samples:92 or 128 levels8000 samples/second
1.544 Mb/s (T1 carrier)
local office
tolloffice
home computerhome computerService Provider
(ISP)
Service Provider(ISP)
InterfaceInterface
V.90 modemreceiver
V.90 modemreceiver
ADCADC
Binary Signal:56,000 bits/second
Key: no analogconversion at ISP
Lecture 4, 20-755: The Internet, Summer 1999 22
Connecting nearby computers using Ethernet
• History– 1976- proposed by Metcalfe and Boggs at Xerox PARC
– 1978 - standardized by Xerox, Intel, DEC
• Bandwidth– 10 Mbits/sec (old) , 100 Mbits/sec (current), 1GB/s (new)
• Key features– broadcast over shared bus (the ether)
» no centralized bus arbiter
» each adapter sees the same bit stream
– each adapter has a unique (for all time!) 48-bit address
– variable length frames (packets) (64 - 1518 bytes)
Lecture 4, 20-755: The Internet, Summer 1999 23
Ethernet cabling
controllercontroller
10Base5 (“thick ethernet”)
transceiver (carrier and collision detection)
50 m
transceiver &controller
transceiver &controller
10Base2 (“thin ethernet”)
transceiver &controller
transceiver &controller
10Base-T
hubhub
name cable max segment nodes/segment advantages
10Base5 thick coax 500 m 100 good for backbones10base2 thin coax 200 m 30 cheapest10Base-T twisted pair 100 m 1024 easy maintenance10Base-F fiber 2000 m 1024 best between bldgs
Source: Tannenbaum
Lecture 4, 20-755: The Internet, Summer 1999 24
Ethernet packet (frame) format
64 bits 48 bits 48 bits 16 bits 368-12000 bits 32 bits
Preamble Destaddr
Srcaddr
Frametype
Payload CRC
64 - 1518 bytes
Preamble: 101010101 (synch)
Dest and Src addr: unique ethernet addresses
Frame type: indicates what packet type it encapsulates
E.g. encapsulated IP packets are denoted by 0x0800
Payload: data (may include encapsulated packets of other protocols)
CRC: cyclic redundancy check (error detection/correction)
8 bits
Postamble
visible from the host
Lecture 4, 20-755: The Internet, Summer 1999 25
Ethernet receiving algorithm
• Ethernet adapter receives all frames.
• Accepts:– frames addressed to its own address
– frames addressed to broadcast address (all 1’s).
– frames addressed to multicast address (1xxx...), if it has been instructed to listen to that address
– all frames, if it has placed in promiscuous mode
• Passes to the host OS (via the exception mechanism) only those packets it accepts.
Lecture 4, 20-755: The Internet, Summer 1999 26
Ethernet sending algorithm (CSMA/CD)• Problem: how to share one wire without centralized control.
• Ethernet solution: Carrier Sense Multiple Access with Collision Detection (CSMA/CD):
• 1. Adapter has frame to send and line is idle:– then send frame immediately
• 2. When adapter has frame to send and line is busy:– wait for line to become idle, then send frame immediately.
• 3. If “collision” (simultaneous sends) occurs during transmission:
– send at least 1024 bits
– send “jam signal” to notify receivers
– wait some period of time (binary exponential backoff)
– retry
Lecture 4, 20-755: The Internet, Summer 1999 27
Binary exponential backoff
FrameFrame
Contention Slots (51.2 us per slot)
Idle
Binary exponential backoff algorithm:
• after 1st collision, wait 0 or 1 contention slots, at random.
• after 2nd collision, wait 0, 1, 2, or 3 contentio slots at random.
• etc up to 1023 slots.
• after 16 collisions, exception.
FrameFrameFrameFrameFrameFrame
Contention interval
Lecture 4, 20-755: The Internet, Summer 1999 28
Why the 64 byte minimum packet size?
AA BB
Assume propagation delay from A to B is tau microseconds (us).
A sends to B at time 0
AA BBpacket almost at B at time tau-eps
AA BBB sends at time tau: collision
AA BBNoise burst gets back to A at time 2*tau
Conclusion: Senders must take morethan 2*tau seconds to send their packets.
For ethernet, 2*tau is specified by standard(2500 m cable w/ 4 repeaters) to be 51.2 us,which at 10 Mb/s is 512 bit times, or 64 bytes.
Rough estimate: propagation through copperis about 20 cm/ns. With a 2500 m cable,tau is 12.5 us and 2*tau is 25 us.
As speeds increase there are two possibilities:1. increase packet sizes2. decrease maximum cable length
Neither is particularly appealing.
Lecture 4, 20-755: The Internet, Summer 1999 29
Ethernet pros and cons
• Pros:– simple
– robust
– cheap ($50/adapter in 1998)
• Cons:– no quality of service guarantees
» OK for data
» not always OK for real-time bit streams like video or voice
– fixed bit rate
» not keeping up with faster processors
» workstations can produce data at 10-50 MBytes/sec
– prone to congestion
» processors getting faster
» bridged Ethernets can help
Lecture 4, 20-755: The Internet, Summer 1999 30
Break time!
Lecture 4, 20-755: The Internet, Summer 1999 31
Today’s lecture
• Connecting computers (50 min)
• Break (10 min)
• Connecting networks (50 min)
Lecture 4, 20-755: The Internet, Summer 1999 32
The internetworking idea (Kahn, 1972)
• Build a single network (an interconnected set of networks, or internetwork, or internet) out of a large collection of separate networks.
– Each network must stand on its own, with no internal changes allowed to connect to the internet.
– Communications would be on a best-effort basis.
– “black boxes” (later called routers) should be used to connect the networks.
– No global control at the operations level.
Lecture 4, 20-755: The Internet, Summer 1999 33
Internetworking challenges
• Challenges:– heterogeneity
» lots of different kinds of networks (Ethernet, FDDI, ATM, wireless, point-to-point)
» how to unify this hodgepodge?
– scale
» how to provide uniques names for potentially billions of nodes? (naming)
» how to find all these nodes? (forwarding and routing)
• Note: internet refers to a general idea, Internet refers to a particular implementation of that idea (The global IP Internet).
Lecture 4, 20-755: The Internet, Summer 1999 34
Internetworking with repeaters
r
r
r
r
Repeaters (also called hubs)(r in the figure) directly transferbits from their inputs to their outputs
Lecture 4, 20-755: The Internet, Summer 1999 35
Internetworking with repeaters
Host on network A
Host on network B
Telnet, FTP, HTTP, email application
transport
network
data link
physical
application
transport
network
data link
10Base-T physical
Repeater(forwards bits)
Lecture 4, 20-755: The Internet, Summer 1999 36
Internetworking with repeaters:Pros and cons
• Pros– Transparency
» LANS can be connected without any awareness from the hosts.
– Useful for serving multiple machines in an office from one ethernet outlet.
• Cons– Not scalable
» ethernet standard allows only 4 repeaters.
» more than 4 would introduce delays that would break contention detection.
– No heterogeneity
» Networks connected with repeaters must have identical electrical properties.
Lecture 4, 20-755: The Internet, Summer 1999 37
Internetworking with bridges
b
b
b
b
Bridges (b In the figure) maintain a cache of hosts on their input segments.
Selectively transferethernet frames from their inputs to their outputs.
Lecture 4, 20-755: The Internet, Summer 1999 38
Internetworking with bridges
Host on network A
Host on network B
Telnet, FTP, HTTP, email application
transport
network
data link
physical
application
transport
network
data linkCSMA/CD
10Base-T physical
Bridge(forwards ethernet
frames)
Lecture 4, 20-755: The Internet, Summer 1999 39
Bridges
A B C
X Y Z
bridge
Ethernet A
Ethernet X
adapter (interface)
port 1 (really just another adapter)
port 2
Unlike repeaters (which operateat the physical level), bridges operate at the data link level(or link level).
By link level, we mean that theycan parse and understand e.g. ethernet frames (as opposed to IP packets).
Basic forwarding algorithm (flooding): copy each received frame to all other ports.
Lecture 4, 20-755: The Internet, Summer 1999 40
Learning bridges
Problem: Flooding is wasteful
A B C
X Y Z
bridge
Ethernet A
Ethernet X
port 1
port 2
Optimization: Forward packets only when necessary by learning andremembering which hosts are connected to which bridge ports.
Lecture 4, 20-755: The Internet, Summer 1999 41
Learning bridges (cont)
Learning algorithm:
1. start with empty hash table T that maps hosts to ports2. receive frame from host src on port p3. add (src,p) to T4. delete old entries
Forwarding algorithm: 1. receive frame f from host src to host dst on port p 2. if T(dst) = n/a then flood f. else if T(dst) = p then discard f else forward f on port T(dst).
Lecture 4, 20-755: The Internet, Summer 1999 42
Learning bridges (example)
A B C
X Y Z
bridge
Ethernet A
Ethernet X
1
2
host portA 1
A -> C
flood 2 & 3
host portA 1B 1
B -> A
discard
host portA 1B 1X 2
X -> A
forward on 1
P Q R
3 Ethernet P
Lecture 4, 20-755: The Internet, Summer 1999 43
Cycles in bridged networks
1. host writes frame Fto unknown destination
B2B1
F1
2. B1 and B2 flood
F2
B2B1
F
B2B1
F1
4. B1 and B2 flood
F2
B2B1
F1
3. B2 reads F1, B1 reads F2
F2
B2B1
F2
5. B1 reads F1 B2 reads F2
F1
B2B1
F1
6. B1 and B2 flood
F2
Lecture 4, 20-755: The Internet, Summer 1999 44
Spanning tree bridges
B3
A
B4 B5
B
G
B2
B1
C D
E
F
B3
A
B4 B5
B
G
B2
B1
C D
E
F
• Networks are graph nodes, ports are graph edges• Tree is constructed dynamically by a distributed “diffusing computation” that prunes ports.• “spanning” refers only to networks, not bridges
Lecture 4, 20-755: The Internet, Summer 1999 45
Portion of the bridged CMU internet
ATM
PSCpitt.edu
AT&T Sprint
es-weh-cle-4.net.cs(PDL/CMCL Labs)
7th floorWean
es-weh-cl6-2.net.cs
gw.cs
poconos.cmcl
backbone-1.net.csinterlink.sw.net
8th floor Wean
baker porterrtrbone.net
cmu-fddi.psc.net
cyert host
Lecture 4, 20-755: The Internet, Summer 1999 46
Internetworking with bridges:Pros and cons• Pros
– Transparency
» LANS can be connected without any awareness from the hosts
» popular solution for campus-size networks
• Cons– Transparency can be misleading
» looks like a single Ethernet segment, but really isn’t
» packets can be dropped, latencies vary
– Homogeneity
» can only support networks with identical frame headers (e.g., Ethernet/FDDI)
» however, can connect different speed Ethernets
– Scalability
» tens of networks only
– bridges forward all broadcast frames
– increased latency
Lecture 4, 20-755: The Internet, Summer 1999 47
Internetworking with application gateways
• application gateways (g in the figure) connect different networks for particular applications.
• Example: – User on host x posts
news item to gateway machine on network A.
– Gateway on A passes item (along with others) to gateway B.
– User on host y reads message from gateway on B.
g x
g y
Network A
Network B
phone system
Lecture 4, 20-755: The Internet, Summer 1999 48
Internetworking with application gateways
Application gatewayon network A
host on network B
usenet news application
data link
physical
application
data linkmodem
phone physical
Application gatewayon network B
transport
network
Gateway program
Lecture 4, 20-755: The Internet, Summer 1999 49
Internetworking with application gateways:
Pros and cons• Pros
– Heterogeneous
» can connect different types of networks
– Simple
» modems + gateway software
• Cons– Not general-purpose
» each solution is application-specific
Lecture 4, 20-755: The Internet, Summer 1999 50
Internetworking with routers
• Def: An internetwork (internet for short) is an arbitrary collection of physical networks interconnected by routers to provide some sort of host-to-host packet delivery service.
internetinternet
hosthost
hosthost
hosthost
hosthost
Lecture 4, 20-755: The Internet, Summer 1999 51
Building an internet
XX YY ZZ
network 2 (ECE)
adaptoradaptor adaptoradaptoradaptoradaptor
AA BB CC
network 1 (SCS)
adaptoradaptor adaptoradaptoradaptoradaptor
We start with two separate, unconnected computer networks (subnets), which are at different locations, and possibly built by different vendors.
Ethernet ATM
Question: How to present the illusion of one network?
Lecture 4, 20-755: The Internet, Summer 1999 52
Building an internet (cont)
XX YY ZZ
network 2 (ECE)
adaptoradaptor adaptoradaptoradaptoradaptor
AA BB C (router)C (router)
network 1 (SCS)
adaptoradaptor adaptoradaptoradaptoradaptor
Next we physically connect one of the computers, called a router (in this case computer C), to each of the networks.
adaptoradaptor
Lecture 4, 20-755: The Internet, Summer 1999 53
Building an internet (cont)
XX YY ZZ
network 2 (ECE)
adaptoradaptor adaptoradaptoradaptoradaptor
AA BB C (router)C (router)
network 1 (SCS)
adaptoradaptor adaptoradaptoradaptoradaptor adaptoradaptor
128.2.250.1
Finally, we run a software implementation of the Internet Protocol (IP)on each host and router. IP provides a global name space for the hosts, routing messages between network1 and network 2 if necessary.
IP addresses:128.2.250.0128.2.80.0128.2.250.2 128.2.80.1 128.2.80.2 128.2.80.3
Lecture 4, 20-755: The Internet, Summer 1999 54
Building an internet (cont)
internetinternet
128.2.250.1128.2.250.1
128.2.80.3128.2.80.3
128.2.80.1128.2.80.1
128.2.250.0128.2.80.3
128.2.250.0128.2.80.3
128.2.250.2128.2.250.2128.2.80.2128.2.80.2
At this point we have an internet consisting of 6 computers built from2 original networks. Each computer on our internet can communicatewith any other computer. IP provides the illusion that there is just one network.