Title: 20755: The Internet Lecture 4: Internetworking I
120-755 The InternetLecture 4 Internetworking I
- David OHallaron
- School of Computer Science and
- Department of Electrical and Computer Engineering
- Carnegie Mellon University
- Institute for eCommerce, Summer 1999
2Todays lecture
- Connecting computers (50 min)
- Break (10 min)
- Connecting networks (50 min)
3Typical computer system
Keyboard
Mouse
Printer
Modem
Processor
Interrupt controller
Serial port controller
Parallel port controller
Keyboard controller
Local/IO Bus
Network adapter
Video adapter
Memory
IDE disk controller
SCSI controller
SCSI bus
disk
Network
Display
disk
cdrom
4Simple 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
header
payload
0 please send the data word at address 1 here
is the data word you asked for.
5Questions 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!!!
6Generic network
host
host
host
OS code
software
software
software
protocol stack
hardware
hardware
hardware
link
link
link
network adapter/ interface card
Interconnect (wires, repeaters, bridges, etc)
7Protocols
- 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.
8Protocol layering
interface between user code and OS
code (Application program interface (API))
Protocols provide specialized services by relying
on services provided by lower-level protocols
(I.e., they leverage lower-level services).
User application program (FTP, Telnet, WWW, email)
Reliable byte stream delivery (process-process)
Unreliable best effort datagram delivery (process-
process)
User datagram protocol (UDP)
Transmission control protocol (TCP)
Internet Protocol (IP)
Network interface (ethernet)
Unreliable best effort datagram delivery (host-ho
st)
hardware
Physical connection
9Encapsulation
Application program
data
User code
User Interface (API)
OS code
TCP
IP
IP datagram header
TCP segment header
data
OS/adapter interface (exception mechanism)
Adapter
Ethernet frame header
IP datagram header
TCP segment header
data
Adapter/Network interface
Network
10Basic 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 (10s of kilometers)
- 800 Mb/s Gigabit Nectar
- Wide area network (WAN)
- nationwide or worldwide (1000s of kilometers)
- telephone system
- ATT, MCI, Sprint
- 1.544 Mb/s T1 carrier
- 44.736 Mb/s T3 carrier
11Examples of transmission media
twisted pair
fiber
(100-200 Gb/s at 1 km)
(1-2 Mb/s at 1 km)
station wagon full of mag tapes hurtling down
the highway every hour
coaxial cable
(1-2 Gb/s at 1 km)
(15 Gb/s at 1 hour) 7 GBytes/tape 1000
tapes/station wagon (50x50x50cm) 7,000 GBytes
total 7,000 GBytes/3600 seconds 15
Gb/s 5/tape reused 10 times -gt 500 tape
cost 200 for shipping -gt10 cents /GByte
12Shared vs switched media
Shared media (e.g., Ethernet)
Switched media (e.g., ATM)
a
c
a
c
b
d
input ports
output ports
a
c
b
d
b
switch
d
a
c
a
c
b
d
a
c
b
d
b
switch
d
13Network 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.
14Example 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
15ATT Telephone Hierarchy
5
4
3
2
10 regional offices (fully interconnected)
1
10
9
8
7
6
1
2
3
65
66
67
67 sectional offices
1
2
3
228
229
230
230 primary offices
1
2
3
1298
1299
1300
1,300 toll offices
19,000 end offices
local loops
local loops
200 million telephones
Source Tannenbaum
16Connecting distant computers with modems
1.544 Mb/s (T1 carrier)
28.8 Kb/s analog local loop
28.8 Kb/s analog local loop
digital
digital
codec
codec
V.34 modem
V.34 modem
digital (short cable or bus) 33 MB/s
digital (short cable or bus) 33 MB/s
local office
local office
toll office
ISP computer
home computer
17Modulating digital signals
0
1
0
1
1
0
0
1
0
0
1
0
binary signaling
sine wave carrier (1kHz-2kHz)
amplitude modulation
phase modulation 00 no shift 01 1/4 shift
left 10 1/2 shift left 11 3/4 shift
left (shifts are relative to previous wave)
18Quadrature amplitude modulation (QAM)
Modern modems use a combination of of amplitude
and phase modulation to encode multiple bits per
symbol, i.e. amplitude/phase pair.
phase angle is 1/4
1/8
3 bits/symbol QAM modulation (8 symbols)
4 bits/symbol QAM modulation (16 symbols)
19Conventional Modems
MOdulate convert from digital to
analog DEModulate convert from analog to digital
modem standards type symbols/sec bits/symbol Kb
/s v.32 2400 4 9.6 v.32.bis 2400 6 14.4 v.3
4 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 bandwidth and S/N is signal to
noise ratio. For phone network, H3,600 bps and
10 log10 (S/N) 30 dB. Thus max rate is 35 Kb/s.
20T1 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 bits per channel
bit 1 is a framing code
Each channel has a data rate of 8000 samples/s
8 bits/channel 64 Kb/s
2156KB Modems
Key no analog conversion at ISP
V.90 modem receiver
1.544 Mb/s (T1 carrier)
Analog Samples 92 or 128 levels 8000
samples/second
digital
digital
DAC
Interface
ADC
digital (short cable or bus)
local office
toll office
Binary Signal 56,000 bits/second
Service Provider (ISP)
home computer
- 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
22Connecting 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)
23Ethernet cabling
controller
transceiver controller
transceiver controller
transceiver (carrier and collision detection)
50 m
hub
10Base5 (thick ethernet)
10Base2 (thin ethernet)
10Base-T
name cable max segment nodes/segment advantages
10Base5 thick coax 500 m 100 good for
backbones 10base2 thin coax 200
m 30 cheapest 10Base-T twisted pair 100
m 1024 easy maintenance 10Base-F fiber 2000
m 1024 best between bldgs
Source Tannenbaum
24Ethernet packet (frame) format
64 - 1518 bytes
Preamble
Dest addr
Src addr
Frame type
Payload
CRC
Postamble
64 bits
48 bits
48 bits
16 bits
368-12000 bits
32 bits
8 bits
visible from the host
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)
25Ethernet receiving algorithm
- Ethernet adapter receives all frames.
- Accepts
- frames addressed to its own address
- frames addressed to broadcast address (all 1s).
- 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.
26Ethernet 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
27Binary exponential backoff
Contention Slots (51.2 us per slot)
Frame
Frame
Frame
Frame
Idle
Contention interval
- 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.
28Why the 64 byte minimum packet size?
Assume propagation delay from A to B is tau
microseconds (us).
A sends to B at time 0
A
B
Conclusion Senders must take more than 2tau
seconds to send their packets. For ethernet,
2tau 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 copper is about 20 cm/ns.
With a 2500 m cable, tau is 12.5 us and 2tau is
25 us. As speeds increase there are two
possibilities 1. increase packet sizes 2.
decrease maximum cable length Neither is
particularly appealing.
packet almost at B at time tau-eps
A
B
B sends at time tau collision
A
B
Noise burst gets back to A at time 2tau
A
B
29Ethernet 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
30Break time!
31Todays lecture
- Connecting computers (50 min)
- Break (10 min)
- Connecting networks (50 min)
32The 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.
33Internetworking 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).
34Internetworking with repeaters
r
Repeaters (also called hubs) (r in the figure)
directly transfer bits from their inputs to their
outputs
r
r
r
35Internetworking with repeaters
Telnet, FTP, HTTP, email
application
application
transport
transport
network
network
data link
data link
physical
physical
10Base-T
Host on network A
Host on network B
Repeater (forwards bits)
36Internetworking with repeatersPros 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.
37Internetworking with bridges
b
Bridges (b In the figure) maintain a cache of
hosts on their input segments. Selectively
transfer ethernet frames from their inputs to
their outputs.
b
b
b
38Internetworking with bridges
Telnet, FTP, HTTP, email
application
application
transport
transport
network
network
CSMA/CD
data link
data link
physical
physical
10Base-T
Host on network A
Host on network B
Bridge (forwards ethernet frames)
39Bridges
adapter (interface)
A
B
C
port 1 (really just another adapter)
Ethernet A
bridge
port 2
Ethernet X
Unlike repeaters (which operate at the physical
level), bridges operate at the data link
level (or link level). By link level, we mean
that they can parse and understand e.g. ethernet
frames (as opposed to IP packets). Basic
forwarding algorithm (flooding) copy each
received frame to all other ports.
X
Y
Z
40Learning bridges
Problem Flooding is wasteful
A
B
C
port 1
Ethernet A
bridge
port 2
Ethernet X
X
Y
Z
Optimization Forward packets only when necessary
by learning and remembering which hosts are
connected to which bridge ports.
41Learning bridges (cont)
Learning algorithm 1. start with empty hash
table T that maps hosts to ports 2. receive frame
from host src on port p 3. add (src,p) to T 4.
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).
42Learning bridges (example)
A
B
C
P
Q
R
1
3
Ethernet P
Ethernet A
bridge
2
Ethernet X
X
Y
Z
B -gt A
X -gt A
A -gt C
host port A 1 B 1
host port A 1 B 1 X 2
host port A 1
flood 2 3
discard
forward on 1
43Cycles in bridged networks
1. host writes frame F to unknown destination
2. B1 and B2 flood
3. B2 reads F1, B1 reads F2
F
B2
B1
B2
B1
B2
B1
F1
F2
F1
F2
4. B1 and B2 flood
5. B1 reads F1 B2 reads F2
6. B1 and B2 flood
F1
F2
F2
F1
B2
B1
B2
B1
B2
B1
F1
F2
44Spanning tree bridges
A
B
A
B
G
G
B3
B4
B5
B3
B4
B5
C
D
C
D
B2
B2
F
F
E
E
B1
B1
- 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
45Portion of the bridged CMU internet
gw.cs
backbone-1.net.cs
interlink.sw.net
es-weh-cle-4.net.cs (PDL/CMCL Labs)
7th floorWean
baker
porter
rtrbone.net
cyert host
cmu-fddi.psc.net
es-weh-cl6-2.net.cs
8th floor Wean
ATM
poconos.cmcl
PSC
pitt.edu
ATT
Sprint
46Internetworking with bridgesPros 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
isnt - 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
47Internetworking 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.
Network A
g
x
phone system
Network B
g
y
48Internetworking with application gateways
Gateway program
application
application
usenet news
transport
network
modem
data link
data link
physical
physical
phone
Application gateway on network A
host on network B
Application gateway on network B
49Internetworking with application gatewaysPros
and cons
- Pros
- Heterogeneous
- can connect different types of networks
- Simple
- modems gateway software
- Cons
- Not general-purpose
- each solution is application-specific
50Internetworking 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.
internet
host
host
host
host
51Building an internet
We start with two separate, unconnected computer
networks (subnets), which are at different
locations, and possibly built by different
vendors.
X
Y
Z
A
B
C
adaptor
adaptor
adaptor
adaptor
adaptor
adaptor
Ethernet
ATM
network 2 (ECE)
network 1 (SCS)
Question How to present the illusion of one
network?
52Building an internet (cont)
Next we physically connect one of the computers,
called a router (in this case computer C), to
each of the networks.
X
Y
Z
A
B
C (router)
adaptor
adaptor
adaptor
adaptor
adaptor
adaptor
adaptor
network 2 (ECE)
network 1 (SCS)
53Building an internet (cont)
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.
128.2.250.0 128.2.80.0
IP addresses
128.2.250.1
128.2.250.2
128.2.80.1
128.2.80.2
128.2.80.3
X
Y
Z
A
B
C (router)
adaptor
adaptor
adaptor
adaptor
adaptor
adaptor
adaptor
network 2 (ECE)
network 1 (SCS)
54Building an internet (cont)
At this point we have an internet consisting of 6
computers built from 2 original networks. Each
computer on our internet can communicate with any
other computer. IP provides the illusion that
there is just one network.
internet
128.2.250.1
128.2.80.1
128.2.250.2
128.2.80.2
128.2.80.3
128.2.250.0 128.2.80.3