1
Lecture 14:
Midterm Review
Slides adapted from:Computer Networks: A Systems Approach (Peterson and Davis)
Computer Networking: A Top Down Approach Featuring the Internet (Kurose and Ross)
ITCS 6166/8166 091Spring 2007
Jamie PaytonDepartment of Computer Science
University of North Carolina at Charlotte
February 21, 2007
2
A hodge podge of topics
• General overview to put things in perspective….
3
What’s the Internet?A “nuts and bolts” view
• millions of connected computing devices: hosts = end systems
• running network apps• communication links
– fiber, copper, radio, satellite– transmission rate =
bandwidth
• routers: forward packets (chunks of data)
local ISP
companynetwork
regional ISP
router workstation
servermobile
4
Network Structure
• network edge: applications and hosts
• network core: – routers
– network of networks
• access networks, physical media: communication links
5
Network Edge• end systems (hosts):
– run application programs– e.g. Web, email– at “edge of network”
• client/server model– client host requests, receives
service from always-on server– e.g. Web browser/server; email
client/server
• peer-peer model:– minimal (or no) use of dedicated
servers– e.g. Skype, BitTorrent, KaZaA
6
The Network Edge Connection-oriented Service
Goal: data transfer between end systems
• handshaking: setup (prepare for) data transfer ahead of time– Hello, hello back human
protocol
– set up “state” in two communicating hosts
• TCP - Transmission Control Protocol – Internet’s connection-
oriented service
TCP service [RFC 793]
• reliable, in-order byte-stream data transfer– loss: acknowledgements
and retransmissions
• flow control: – sender won’t overwhelm
receiver
• congestion control: – senders “slow down sending
rate” when network congested
7
The Network Edge
Connectionless service
Goal: data transfer between end systems– same as before!
• UDP - User Datagram Protocol [RFC 768]: – connectionless – unreliable data transfer– no flow control– no congestion control
App’s using TCP: • HTTP (Web), FTP (file
transfer), Telnet (remote login), SMTP (email)
App’s using UDP:• streaming media,
teleconferencing, DNS, Internet telephony
8
The Network Core
• mesh of interconnected routers
• the fundamental question: how is data transferred through net?– circuit switching:
dedicated circuit per call: telephone net
– packet-switching: data sent thru net in discrete “chunks”
9
The Network Core
Circuit Switching
End-end resources reserved for “call”
• link bandwidth, switch capacity
• dedicated resources: no sharing
• circuit-like (guaranteed) performance
• call setup required
10
The Network Core
Circuit Switchingnetwork resources
(e.g., bandwidth) divided into “pieces”
• pieces allocated to calls
• resource piece idle if not used by owning call (no sharing)
• dividing link bandwidth into “pieces”– frequency division– time division
11
Circuit Switching
FDM and TDM
FDM
frequency
time
TDM
frequency
time
4 users
Example:
12
The Network Core
Packet Switching
each end-end data stream divided into packets
• user A, B packets share network resources
• each packet uses full link bandwidth
• resources used as needed
resource contention: • aggregate resource
demand can exceed amount available
• congestion: packets queue, wait for link use
• store and forward: packets move one hop at a time– Node receives complete
packet before forwarding
13
Packet Switching
Statistical Multiplexing
Sequence of A & B packets does not have fixed pattern, shared on demand statistical multiplexing.
TDM: each host gets same slot in revolving TDM frame
A
B
C100 Mb/sEthernet
1.5 Mb/s
D E
statistical multiplexing
queue of packetswaiting for output
link
14
Packet-switching
Store-and-Forward
• Takes L/R seconds to transmit (push out) packet of L bits on to link or R bps
• Entire packet must arrive at router before it can be transmitted on next link: store and forward
• delay = 3L/R (assuming zero propagation delay)
Example:• L = 7.5 Mbits• R = 1.5 Mbps• delay = 15 sec
R R RL
15
Packet switching versus circuit switching
• 1 Mb/s link• each user:
– 100 kb/s when “active”
– active 10% of time
• circuit-switching: – 10 users
• packet switching: – with 35 users, probability >
10 active less than .0004
Packet switching allows more users to use network!
N users
1 Mbps link
Q: how did we get value 0.0004?See notes from lecture!
16
Packet switching versus circuit switching
• Great for bursty data– resource sharing– simpler, no call setup
• Excessive congestion: packet delay and loss– protocols needed for reliable data transfer,
congestion control• Q: How to provide circuit-like behavior?
– bandwidth guarantees needed for audio/video apps– still an unsolved problem (chapter 7)
Is packet switching a “slam dunk winner?”
17
Delays in Packet-Switched Networks
• Transmission delay– Sending of bits onto the wire– Depends on link bandwidth
• Propagation delay– Propagation of bits inside the wire– Depends on medium
• Processing delay– Handling of bits on receiving end– Depends on processor and memory speed
• Queuing delay– Wait time due to statistical multiplexing– Depends on network load and scheduling algorithm
18
Understanding Packet Delay• Transmission delay:
– R=link bandwidth (bps)– L=packet length (bits)– time to send bits into
link = L/R
A
B
propagation
transmission
nodalprocessing queueing
19
Understanding Packet Delay
A
B
propagation
transmission
nodalprocessing queueing
• Propagation delay:– d = length of physical link– s = propagation speed in medium (~2x108
m/sec)– propagation delay = d/s
Note: s and R are very different quantities!
20
Understanding Packet Delay
• Processing delay:– B = Check bit errors– O = Determine
output link– Delay = b + o
A
B
propagation
transmission
nodalprocessing queueing
21
Understanding Packet Delay
• Queuing delay:– Time waiting at output
link for transmission – Depends on
congestion level of router
A
B
propagation
transmission
nodalprocessing queueing
• Complex topic– Varies from packet to
packet!• Must use statistical
measures to estimate queuing delay
– Thousands of research papers written on queuing delay
22
Overview of Queuing Delay
• R=link bandwidth (bps)
• L=packet length (bits)
• a=average packet arrival rate
traffic intensity = La/R• La/R ~ 0: average queueing delay small• La/R -> 1: delays become large• La/R > 1: more “work” arriving than can
be serviced, average delay infinite!
23
Caravan analogy
• Analogy– Car ~ bit– Caravan ~ packet– Toll booth ~ host
• 12 sec to take money from each car
– Highway ~ connection• Speed limit is 100 km/hr
toll booth
toll booth
ten-car caravan
100 km
100 km
• Q: How long until caravan is lined up before 2nd toll booth?
24
Nodal Delay
• dproc = processing delay– typically a few microsecs or less
• dqueue = queuing delay– depends on congestion
• dtrans = transmission delay– = L/R, significant for low-speed links
• dprop = propagation delay– a few microsecs to hundreds of msecs
proptransqueueprocnodal ddddd
25
Packet Loss
• Queue (aka buffer) has finite capacity
• When packet arrives to full queue, packet is dropped (i.e., lost)
• Lost packet may be:– Retransmitted by previous node– Retransmitted by source end system– Not retransmitted at all
• We’ll discuss techniques for dealing with lost packets later in the semester
26
Network Protocol Layers
• Network functionality is organized into layers– Each layer implements a service
• Layer actions are encapsulated• Each layer relies on services
provided by layer below
• Benefits of layered approach– Modularity
• Simplifies maintenance, updating
– Explicit structure • Allows identification, relationship of
system pieces
application
transport
network
link
physical
27
Internet Protocol Stack
• application: network applications– FTP, SMTP, HTTP– application-layer messages
• transport: data transfer– TCP, UDP– segments
• network: routing data from source to destination– IP, routing protocols– datagrams
• link: data transfer between neighboring network elements– PPP, Ethernet– frames
• physical: bits “on the wire”
application
transport
network
link
physical
28
sourceapplicatio
ntransportnetwork
linkphysical
HtHn M
segment Ht
datagram
destination
application
transportnetwork
linkphysical
HtHnHl M
HtHn M
Ht M
M
networklink
physical
linkphysical
HtHnHl M
HtHn M
HtHn M
HtHnHl M
router
switch
Encapsulationmessage M
Ht M
Hn
frame
29
Change Gears…
• Now we’ll talk about stuff at the application layer– See lecture slides for application layer!
30
Change Gears…
• Now we’ll talk about stuff at the transport layer– UDP – TCP
• See lecture slides for TCP and congestion control!
31
Changing Gears…
• Now we’ll talk about stuff specifically at the network layer– IP addressing– Forwarding and routing
32
IP Addressing: introduction• IP address: 32-bit
identifier for host, router interface
• interface: connection between host/router and physical link– router’s typically have
multiple interfaces– host typically has one
interface– IP addresses
associated with each interface
223.1.1.1
223.1.1.2
223.1.1.3
223.1.1.4 223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2223.1.3.1
223.1.3.27
223.1.1.1 = 11011111 00000001 00000001 00000001
223 1 11
33
Subnets• IP address:
– subnet part (high order bits)
– host part (low order bits)
• What’s a subnet ?– device interfaces
with same subnet part of IP address
– can physically reach each other without intervening router
223.1.1.1
223.1.1.2
223.1.1.3
223.1.1.4 223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2223.1.3.1
223.1.3.27
network consisting of 3 subnets
subnet
34
Subnets 223.1.1.0/24223.1.2.0/24
223.1.3.0/24
Recipe• To determine the
subnets, detach each interface from its host or router, creating islands of isolated networks. Each isolated network is called a subnet.
Subnet mask: /24
35
IP addressing: CIDRCIDR: Classless InterDomain Routing
– subnet portion of address of arbitrary length– address format: a.b.c.d/x, where x is # bits in
subnet portion of address
11001000 00010111 00010000 00000000
subnetpart
hostpart
200.23.16.0/23
36
NAT: Network Address Translation
10.0.0.1
10.0.0.2
10.0.0.3
10.0.0.4
138.76.29.7
local network(e.g., home network)
10.0.0/24
rest ofInternet
Datagrams with source or destination in this networkhave 10.0.0/24 address for
source, destination (as usual)
All datagrams leaving localnetwork have same single source
NAT IP address: 138.76.29.7,different source port numbers
37
Network Layer Overview:
Forwarding and Routing
• Forwarding: move packets from router’s input to appropriate router output
• Routing: determine route taken by packets from source to dest.
– routing algorithms
analogy:
• routing: process of planning trip from source to destination
• forwarding: process of getting through single interchange
38
1
23
0111
value in arrivingpacket’s header
routing algorithm
local forwarding table
header value output link
0100010101111001
3221
Network Layer Overview:
Forwarding and Routing
39
Forwarding table Destination Address Range Link Interface
11001000 00010111 00010000 00000000 through 0 11001000 00010111 00010111 11111111
11001000 00010111 00011000 00000000 through 1 11001000 00010111 00011000 11111111
11001000 00010111 00011001 00000000 through 2 11001000 00010111 00011111 11111111
otherwise 3
4 billion possible entries
40
Longest prefix matching
Prefix Match Link Interface 11001000 00010111 00010 0 11001000 00010111 00011000 1 11001000 00010111 00011 2 otherwise 3
DA: 11001000 00010111 00011000 10101010
Examples
DA: 11001000 00010111 00010110 10100001 Which interface?
Which interface?
41
Internet inter-AS routing: BGP
• BGP (Border Gateway Protocol): the de facto standard
• BGP provides each AS a means to:1. Obtain subnet reachability information from
neighboring ASs.2. Propagate reachability information to all AS-internal
routers.3. Determine “good” routes to subnets based on
reachability information and policy.
• allows subnet to advertise its existence to rest of Internet: “I am here”
42
BGP basics• Pairs of routers (BGP peers) exchange routing info
over semi-permanent TCP connections: BGP sessions– BGP sessions need not correspond to physical links.
• When AS2 advertises a prefix to AS1, AS2 is promising it will forward any datagrams destined to that prefix towards the prefix.– AS2 can aggregate prefixes in its advertisement
3b
1d
3a
1c2aAS3
AS1
AS21a
2c
2b
1b
3c
eBGP session
iBGP session
43
Distributing reachability info• With eBGP session between 3a and 1c, AS3 sends prefix
reachability info to AS1.• 1c can then use iBGP do distribute this new prefix reach info to
all routers in AS1• 1b can then re-advertise new reachability info to AS2 over 1b-
to-2a eBGP session• When router learns of new prefix, creates entry for prefix in its
forwarding table.
3b
1d
3a
1c2aAS3
AS1
AS21a
2c
2b
1b
3c
eBGP session
iBGP session
44
Path attributes & BGP routes
• When advertising a prefix, advert includes BGP attributes. – prefix + attributes = “route”
• Two important attributes:– AS-PATH: contains ASs through which prefix advertisement has
passed: AS 67 AS 17 – NEXT-HOP: Indicates specific internal-AS router to next-hop
AS. (There may be multiple links from current AS to next-hop-AS.)
• When gateway router receives route advertisement, uses import policy to accept/decline.
45
BGP route selection
• Router may learn about more than 1 route to some prefix. Router must select route.
• Elimination rules:1. Local preference value attribute: policy
decision
2. Shortest AS-PATH
3. Closest NEXT-HOP router: hot potato routing
4. Additional criteria
46
BGP messages
• BGP messages exchanged using TCP• BGP messages:
– OPEN: opens TCP connection to peer and authenticates sender
– UPDATE: advertises new path (or withdraws old)– KEEPALIVE keeps connection alive in absence of
UPDATES; also ACKs OPEN request– NOTIFICATION: reports errors in previous msg; also
used to close connection
47
BGP routing policy
Figure 4.5-BGPnew: a simple BGP scenario
A
B
C
W X
Y
legend:
customer network:
provider network
• A,B,C are provider networks• X,W,Y are customer (of provider networks)• X is dual-homed: attached to two networks
– X does not want to route from B via X to C– .. so X will not advertise to B a route to C
48
BGP routing policy (2)
Figure 4.5-BGPnew: a simple BGP scenario
A
B
C
W X
Y
legend:
customer network:
provider network
• A advertises to B the path AW • B advertises to X the path BAW • Should B advertise to C the path BAW?
– No way! B gets no “revenue” for routing CBAW since neither W nor C are B’s customers
– B wants to force C to route to w via A– B wants to route only to/from its customers!
49
Why different Intra- and Inter-AS routing ? Policy: • Inter-AS: admin wants control over how its traffic routed,
who routes through its net. • Intra-AS: single admin, so no policy decisions needed
Scale:• hierarchical routing saves table size, reduced update
traffic
Performance: • Intra-AS: can focus on performance• Inter-AS: policy may dominate over performance
50
Summary
• Routing!!!
• Next time– Midterm
• After break– More routing!!!