You are on page 1of 14

Review

F Describe each of the following in terms of


network layers
– Repeater
– Hub/Switch
– Bridge Computer Networks
– Router

Network Layer

Topics Introduction to Network Layer


F Introduction (5 - 5.1) ← F Service to transport layer
F Routing (5.2) F Getting packets from source to destination
F Congestion Control (5.3) – may require many hops
– data link layer from one end of wire to another
F Internetworking (5.4) 7
F Must know topology of subnet
F Misc (5.5 - 5.6)
F Avoid overloading routes
– the Internet, ATM
F Deal with different networks

Network Layer Services Connectionless


F Depend upon services to Transport Layer
F Internet camp
F Often network carrier to network customer
– 30 years of experience with real networks
– very well defined – subnet is unreliable, no matter how well
F Goals designed
– services independent of subnet technology – hosts should accept this and do error control and
– shield transport layer from topology flow control
– uniform number of network addresses, across – SEND_PACKET and RECV_PACKET
LANs or WANS – each packet full information on source, dest
F Lots of freedom, but two factions – no ordering or flow control since will be
– connection-oriented and connectionless redundant with transport 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

– communicate in both directions – subnet (connected)


– all packets delivered in sequence u most users don’t want complex protocols on their machines
– embedded systems don’t
u some might still be lost
u real-time services much better on connected
– flow control to help slow senders
F (Un) Connected, (Un) Reliable
– 4 classes, but two are the most popular

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

Examples of Services Topics


F Introduction (5 - 5.1) 4
F Routing (5.2) ←
F Congestion Control (5.3)
F Misc (5.5 - 5.6)
– the Internet, ATM

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

Two Classes of Routing Algorithms


Optimality Principal
F Non-Adaptive algorithms
– decisions not based on measurements “If J is on optimal path from I to K, then
– routes computed offline in advance optimal path from J to K is also on that path”
– also called Static Routing
F Adaptive algorithms F Explanation by contradiction:
– change routes based on topology and traffic – Call I to J, r1 and J to K, r2
– info: locally, adjacent routers, all routers – Assume J to K has a route better than r2, say r3
– freq: every ∆T seconds, load change, topology change – Then r1r3 is shorter than r1r2
F Metric? u contradiction!
– distance, number of hops, transit time F Useful when analyzing specific algorithms

Sink Tree Sink Trees


F Set of optimal nodes to a given destination
F Not necessarily unique
F No loops
F Routing algorithms want sink trees – each packet delivered in finite time
– well, routers go up and down and have different
notions of sink trees
F How is sink tree information collected?
– we’ll talk about this later
F Next up: static routing algorithms
F On deck: adaptive algorithms

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

Dijkstra’s Algorithm: A to D Flooding


F Send every incoming packet on every
outgoing link
– problems?
F Vast numbers of duplicate packets
– infinite, actually, unless we stop. How?
F Hop count: decrease each hop
F Sequence number: don’t flood twice
F Selective flooding: send only in about the
right direction

Uses of Flooding Flow Based Routing


F Military applications F Above algorithms only consider topology
– redundancy is nice – Do not consider load
– routers can be blown to bits
F Distributed databases
– multiple sources
– update all at once
F Baseline
– flooding always chooses shortest path F Ex: if huge traffic from A to B then better
– compare other algorithm to flooding path would be AGEFC
F Min average delay for the entire subnet

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

– adaptive ← – Original Internet routing algorithm


F Congestion Control (5.3) F Link state routing
F The Internet (5.4, brief) – Modern Internet routing algorithm

Distance Vector Routing


Distance Vector Routing
Computation
F Each router has table F Just got Routing Table from X
– preferred outgoing line – Xi is estimate of time from X to i
– estimate of “distance” to get there F Delay to X is m msec
F Assume knows “distance” to each neighbor F Know distance to X (say, from ECHO’s)
– if hops, just 1 hop – Can reach router i via X in Xi + m msec
– if queue length, measure the queues F Do for all neighbors
– if delay, can send PING packet
F Closest to i as “preferred outgoing line”
F Exchange tables with neighbors periodically
F Can then make new routing table

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

Link State Routing Learning Neighbors


F Used (w/variations) on Internet since 1979 F Upon boot, send HELLO packet along point-
F Basically to-point line
– Experimentally measure distance – names must be unique
– Use Dijkstra’s shortest path F Routers attached to LAN?
F Steps
– Discover neighbors
– Measure delay to each
– Construct a packet telling what learned
– Send to all other routers
– Compute shortest path

Measuring Line “Cost” Building Link State Packets


F Send ECHO packet, other router returns F Identity of sender, sequence number, age,
– delay
list of (neighbors + distance)
F Factor in load (queue length)?
– Yes, if other distance equal, will improve perf
– No, oscillating routing tables
– Ex: Back and forth between C-F and E-I

F When to send them?

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

Keeping Track of Packets Keeping Track of Packets

Station
B

F E arrived via EAB and via EFB


F A arrived F F arrived
– send only to C
– ack A – ack F
– forward A and C
F If C arrives via F before forwarded,
– forward C and F
updated bits and don’t send to F

Computing New Routes Link State Routing Today


F Router has all link state packets
– build subnet graph F Open Shortest Path First (OSPF) (5.5.5)
F N routers degree K, O(KN) space – used in Internet today
F Problems F Intermediate Sys Intermediate Sys (IS-IS)
– router lies: forgets link, claims low distance – used in Internet backbones
– router fails to forward, or corrupts packets – variant used for IPX in Novell networks
– router runs out of memory, calculates wrong – carry multiple network layer protocols
– with large subnets, becomes probable
F Limit damage from above when happens

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”

Address Resolutioning ARP Optimizations


F Host 1 broadcasts packet asking “Who
F Send to H2 again?
owns IP address 192.31.65.5 ?”
– cache requests (time out in case of new card)
F Each machien checks its IP address.
F Many times, H1 requires ack from H2
F Host 2 responds w/Ethernet address (E2) – send H1 IP + enet (192.31.65.7 , E2)
– Address Resolution Protocol (ARP) – H2 caches and uses if needed
F Host 1 data-link can then encapsulate IP F Hosts broadcast mapping when boot
packet in frame addressed to E2 and dump
– host looks for its own IP address
F Enet board on Host 2 recognizes, strips u should get no answer, else don’t boot
frame header and sends up to IP layer – other enet hosts all can cache answer

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

Inside Out and Upside Down


Either way ...
F Can a host learn its IP address at boot?
F Host 1 packs IP into Enet frame to E3 – Reverse Address Resolution Protocol (RARP)
F CS router receives frame, removes packet F Broadcast:
– sees 192.31.63.0 to 192.31.60.7 – “my enet adress 13.05.05.18.01.25”
F Sends ARP packet onto FDDI – “does anyone know my IP?”
– learns 192.31.60.7 is at F3 F RARP server sees request, sends IP
F Puts packet into payload of FDDI frame and F Allows sharing boot images
put on ring – IP not hard-coded
F EE router receives frame, removes packet ... F RARP broadcasts not across router
– BOOTP uses UDP

Routing on the Internet Open Shortest Path First (OSPF)


F Internet made up of Autonomous Systems F 1979, RIP, distance vector, replaced by
(AS) link-state
F Standard for routing inside AS F In 1990, OSPF standardized
– interior gateway protocol F “O” is for “Open”, not proprietary
– OSPF F ASes can be large, need to scale
F Standard for routing outside AS – Areas, that are self-contained (not visible from
– exterior gateway protocol outside)
– BGP

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

Border Gateway Protocol (BGP) BGP


F Inside AS, only efficiency F Types of networks
F Between AS, have to worry about politics – stub: only one connection
– No transit traffic through some ASes – multiconnected: could transit, but don’t
– Never put Iraq on a route starting at the Pentagon – transit: handle 3rd party, but with restrictions
– Do not use the US to get from British Columbia (backbones)
to Ontario F BGP router pairs communicate via TCP
– Traffic starting or ending at IBM should not – hides details in between
transit Microsoft F Uses distance vector protocol
– but “cost” can be any metric

BGP Hierarchical Routing


F Global picture difficult for large networks
F Divide into regions
– Router knows detail of its region
– Routers in other regions reduced to a point

F gets all paths, uses “distance” function for best


Count to infinity fixed
RFC 1654

10
Reduced Routing Table Congestion

Losing packets
makes things
worse
•Cost is efficiency
•Consider 1A to 5C
•via 3 better for most of 5

Causes of Congestion Flow Control vs. Congestion Control


F Queue build up until full F Congestion control (network layer)
– Many input lines to one output line – make sure subnet can carry offered traffic
– Slow processors – global issues, including hosts and routers
– Low-bandwidth lines F Flow control (data link layer)
u system components mismatch (bottleneck)
– point-to-point between sender and receiver
– Insufficient memory to buffer
– fast sender does not overpower receiver
F If condition continues, infinite memory makes – involves direct feedback to sender by receiver
worse!
F Ex: Super-computer to PC w/1Gbps line
– timeouts cause even more transmission
F Ex: 1000 computers w/1 Mbps lines
– congestion feeds upon itself until collapse
transferring files at 1kbps to other half

Topics Principles of Congestion Control


F Control theory: open loop and closed loop
F The Network Layer F Open loop: ahead of time
– Introduction 4 – solve problem by making sure doesn’t happen
– Routing (5.2) 4 – when to accept new traffic
– The Internet (5.5, brief) 4 – deciding to discard packets and which ones
– Congestion Control (5.3) ← – scheduling decisions within the network

F The Transport Layer F Closed loop: feedback


– detect congestion … how?
– pass information to system that can adjust

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

Traffic Shaping The Leaky Bucket


F Limit rate data is sent F No matter how fast
water enters bucket,
F User and subnet agree upon certain pattern
drips out at same rate
(shape) of traffic –ρ
– especially important for real-time traffic F If bucket is empty,
– easier on virtual circuit, but possible on datagram – then ρ is 0
F Monitoring agreement is traffic policing F If bucket is full, then
spills over sides
– i.e. - lost

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

(a) is w/out bucket, (b) is with bucket

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:

Traffic Shaping with Token Bucket Token Bucket Example


F 250 Kb token bucket
F Leaky bucket does not allow hosts to “save
F Token rate allows 2Mb/sec
up” for sending later
F 25 Mb/sec arrives for 40 sec
F Token bucket host can capture up to some
– can drain at this rate for about 10 seconds
max n tokens
– then must cut back to 2 Mb/sec
F Since hosts must stop transmitting when no
tokens, then can avoid lost data
– leaky bucket will just drop data, resulting in
timeouts and retransmissions (or, just lost data)

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

You might also like