Professional Documents
Culture Documents
Network Layer
1
Connected Vs Connectionless
Connection-Oriented
F Really, where to put the complexity
F Telephone company camp – transport layer (connectionless)
– 100 years of international experience u computers cheap
– set up connection between end hosts u don’t clutter network layer since relied upon for years
– negotiate about parameters, quality and cost u some applications don’t want all those services
Summary Comparison
Internal Organization
F Virtual Circuit
– do not choose new route per packet
– establish route and re-use
– terminate route when terminate connection
F Datagrams
– no advance routes
– each packet routed independently
– more work but more robust
2
Routing Algorithms
F correctness and simplicity (obviously) Optimality vs. Fairness
F robustness
u parts can fail, but system should not F What to optimize?
u topology can change – Minimize delay
F stability – Maximize network throughput
– But basic queuing theory says if system near
F fairness and optimality conflict!
capacity then long delays!
F Compromise: minimize hops (common metric)
– Improves delay
– Reduces bandwidth, so usually increases throughput
3
Static Routing - Start Simple Computing the Shortest Path
F Shortest path routing F Dijkstra’s Algorithm (1959)
F How do we measure shortest? F Label each node with distance from source
F Number of hops – if unknown, then ∞
F Geographic distance F As algorithm proceeds, labels change
F Mean queuing and transmission delay – tentative at first
– permanent when “added” to tree
F Combination of above
4
Topics Modern Routing
F Introduction 4 F Most of today’s computer networks use
F Routing (5.2) dynamic routing
– static 4 F Distance vector routing
Distance Vector
Good News Travels Fast
Example
F A is initially down
F Path to A updated every exchange
F Stable in 4 exchanges
5
Bad News Travels Slowly The Split Horizon Hack
F Report ∞ to router along path
– ex: C says ∞ to reach A when talking to B
F Widely used … but sometimes fails!
F If D goes down
– C can say ∞ to D quickly
F A and B have route
through other
– A and B count to ∞ as
F Sloooowly converges to ∞ (count to infinity) slowly as before!
F Better to set infinity to max + 1 F Other Ad Hoc also fail
6
Distribution Problems
Distributing Link State Packets
F Sequence numbers wrap around
F Tricky if topology changes as packets travel – use 32 bits and will take 137 years
– routes will change “mid-air” based on new topology F Router crashes … start sequence number at 0?
F Basically, use flooding with checks – next packet it sends will be ignored
– increment sequence each time new packet sent F Corrupted packet (65540)
F Forward all new packets – packets 5 - 65540 will be ignored
F Discard all duplicates F Use age field
F If sequence number lower than max for sending – decrement every second
station – if 0, then discard info for that router
– then packet is obsolete and discard F Hold for a bit before processing
Station
B
7
A Slight Change in Plans Network to Data Link Adress
Translation
F The Network Layer F Internet hosts use IP
– Introduction 4 F Data link layer does not understand IP
– Routing (5.2) 4 – Ethernet uses 48-bit address
– The Internet (5.5) ← – ex: ifconfig gives 00:10:4B:9E:B3:E6
u ARP (5.5.4) F Q: How do IP addresses get mapped onto
u OSPF (5.5.5) data link layer addresses, such as Ethernet?
u BGP (5.5.6)
F A: The Address Resolution Protocol (ARP)
– Congestion Control (5.3)
Example 1
Address Resolution
F Lookup IP of eagle.cs.uni.edu
– DNS (chapter 7)
– returns 192.31.65.5
F Host 1 builds packet to 192.31.65.5
– now, how does data link layer know where to
send it?
– need Ethernet address of Host 2
F Could have config file to map IP to Ethernet
– hard to maintain for thousands of machines
Host 1 sends message to Host 2, say “mary@eagle.cs.uni.edu”
8
Example 2 Solutions
F Solution 1
– CS router configured to respond to ARP
requests for 192.31.63.0
– Host 1 makes an ARP cache entry of
(192.31.63.8 , E3)
u sends all traffic to Host 4 to CS router
– Called Proxy ARP
F Solution 2
– Host 1 knows Host 4 is on different subnet
u sends to CS router
Host 1 sends message to Host 4
– CS router doesn’t need to know about remote
Router does not forward data-link layer broadcasts networks
9
OSPF, continued ASes, Backbones and Areas
F Every AS has a backbone, area 0
– all areas connect to backbone, possibly by a
tunnel
F Routers are nodes and links are arcs with
weights
F Computes “shortest” path for each:
– delay
– throughput
– reliability
F Floods link-state packets
10
Reduced Routing Table Congestion
Losing packets
makes things
worse
•Cost is efficiency
•Consider 1A to 5C
•via 3 better for most of 5
11
Closed Loop (cont)
Congestion Control Algorithms
F Metrics to detect congestion:
– percentage of dropped packets F Lots of them
– average queue length – taxonomy to view (Yang and Reddy 1995)
– number of timed out packets
F Open or Closed (as above)
– average packet delay (and std dev of delay)
F Source or Destination
F Transfer info:
F Explicit or Implicit feedback (for closed)
– router to send packet to traffic source(s)
u but this increases the load!
– explicit: send congestion info back to source
– set bit in acks going back (ECN) – implicit: source deduces congestion (by looking
at round-trip time for acks, say)
F Send probe packets out to ask other routers
– ala traffic helicopters to help route cars
Congestion Fix
Preventing Congestion
F Load is greater than resources
– increase resources or decrease load F Traffic is often bursty
F Increase resources – periods of lots of traffic
– adding extra leased bandwidth – followed by periods of little traffic
– boost satellite power F If steady rate, easier to avoid congestion
– split traffic over multiple routes F Open loop method to help manage
– use backup, fault-tolerant routers congestion by forcing packets at more
– … Difficult under many systems! predicable rate
F Decrease load – Traffic Shaping
– at data link, network or transport layer
12
The Leaky Bucket Algorithm Leaky Example
F 200 Mbps network
F Each router has finite F 2 Mbps for long intervals
internal queue
F 25 MB/sec for 40 sec
– excess packets discarded
F One packet per tick sent
– or fixed bytes, if different
sized packets
Leaky Enhancements
Token Bucket Example
•station wants to
F Leaky bucket enforces rigid output rate
send 5 packets
– instead, allow some speedup of output
– token bucket algorithm • there are 3
F Token generated every ∆T seconds tokens
– to send packet, station must capture and destroy
F Example:
13
Closed-Loop Congestion Control Choke Packets (cont)
F Router monitors utilization (queue, cpu … ) F When source receives choke packet, reduces
– ex: each line a real number 0.0 to 10.0
traffic by X percent
– reduce window size or bucket parameters
– how to sample?
u f is instantaneous sample (0 or 1) – decrease 0.5, 0.25, … increase slowly, too
u unew = auold + (1-a) f F Ignore new choke packets from destination
u a determines how fast “forgets” old state for some time interval
– consider a = 0 and a = 1
– why?
F u above threshold then enters a “warning” state
F Increase flow at some time
– router sends choke packet to source
F Variations: degrees of warning
– original packet is tagged so will not generate more
choke packets
Foul Play
Fair Queuing
F Consider A, B and C send through Router
F Router detects congestion, sends choke packet F Multiple queues for each output line
to each – one per source
F A cuts back packet rate but B and C continue F Do round-robin among queues
blasting away – with n hosts competing, get 1/n of bandwidth
– requires voluntary cutback
F Sending more packets will not help
F Transport protocols:
F Trouble?
– TCP: built in flow-control helps congestion
– More bandwidth to hosts with large packets
control
– UDP: mis-behaved flows F Solution: byte-by-byte round robin
F Solution: fair queuing
14