Network Layer —— the core of networking. The Network Core mesh of interconnected routers the...
-
Upload
jacob-willis -
Category
Documents
-
view
217 -
download
1
Transcript of Network Layer —— the core of networking. The Network Core mesh of interconnected routers the...
Network Layer
—— the core of networking
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”
Network layer functions
transport packet from sending to receiving hosts
network layer protocols in every host, router
Three important functions: path determination: route
taken by packets from source to dest. Routing algorithms
switching: move packets from router’s input to appropriate router output
call setup: some network architectures require router call setup along path before data flows
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
application
transportnetworkdata linkphysical
application
transportnetworkdata linkphysical
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
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– transmit over link– wait turn at next
link
Bandwidth division into “pieces”Dedicated allocationResource reservation
Network core: routingGoal: move data among routers from source to dest.
datagram packet network: destination address determines
next hop routes may change during session analogy: driving, asking directions No notion of call state
virtual circuit network: packet carries tag, tag
determines next hop fixed path (for call) determined at
call setup time routers maintain little per-call
state; resources not allocated
circuit-switched network: call allocated time
slots of bandwidth at each link
fixed path (for call) determined at call setup
switches maintain lots of per call state (what?): resource allocation
Packet switching vs circuit switching: why?
“reliability” – no congestion, in order data in circuit-switching
packet switching: better bandwidth use state, resources: packet switching has less sta
te good: less control-plane processing resources along
the way More dataplane (address lookup) processing
failure modes (routers/links down): packet switching routing reconfigures sub-second ti
mescale; circuit-switching: more complex recovery – need to i
nvolve all (downstream) switches on path
Virtual circuits
call setup, teardown for each call before data can flow each packet carries VC identifier (not destination host ID) every router on source-dest path maintains “state” for
each passing connection transport-layer connection only involved two end systems
link, router resources (bandwidth, buffers) may be allocated to VC to get circuit-like performance.
“source-to-dest path behaves much like telephone circuit” performance-wise network actions along source-to-dest path
Virtual circuits: signaling protocols
used to setup, maintain teardown VC used in ATM, frame-relay, X.25 not used in today’s Internet
application
transportnetworkdata linkphysical
application
transportnetworkdata linkphysical
1. Initiate call 2. incoming call
3. Accept call4. Call connected5. Data flow begins 6. Receive data
Datagram networks: the Internet model
no call setup at network layer routers: no state about end-to-end connections
no network-level concept of “connection”
packets typically routed using destination host ID packets between same source-dest pair may take
different paths
application
transportnetworkdata linkphysical
application
transportnetworkdata linkphysical
1. Send data 2. Receive data
Datagram or VC network
Internet• data exchange among
computers– “elastic” service, no
strict timing req. • “smart” end systems
(computers)– can adapt, perform
control, error recovery– simple inside network,
complexity at “edge”• many link types
– different characteristics– uniform service difficult
ATM• evolved from telephony• human conversation:
– strict timing, reliability requirements
– need for guaranteed service
• “dumb” end systems– telephones– complexity inside
network
Datagram or VC network
Routing: Store-and-Forward
• Store-and-Forward Packet Switching
A host with a packet to send transmits it to the nearest router, either on its own LAN or over a point-to-point link to the carrier. The packet is stored there until it has fully arrived so the checksum can be verified. Then it is forwarded to the next router along the path until it reaches the destination host, where it is delivered.
Router Architecture Overview
Two key router functions: • run routing algorithms/protocol• forwarding datagrams from incoming to outgoing link
Input Port Functions
Decentralized switching: • given datagram dest., lookup output
port using forwarding table in input port memory
• goal: complete input port processing at ‘line speed’
• queuing: if datagrams arrive faster than forwarding rate into switch fabric
Physical layer:bit-level reception
Data link layer:e.g., Ethernet
Three types of switching fabrics
Switching Via MemoryFirst generation routers:• traditional computers with switching under direct control of CPU•packet copied to system’s memory• speed limited by memory bandwidth (2 bus crossings per datagram)
InputPort
OutputPort
Memory
System Bus
Switching Via a Bus
• datagram from input port memory
to output port memory via a shared bus
• bus contention: switching speed limited by bus bandwidth
• 1 Gbps bus, Cisco 1900: sufficient speed for access and enterprise routers (not regional or backbone)
Switching Via An Interconnection Network (CrossBar)
• overcome bus bandwidth limitations• Banyan networks, other interconnection nets
initially developed to connect processors in multiprocessor
• Advanced design: fragmenting datagram into fixed length cells, switch cells through the fabric.
• Cisco 12000: switches Gbps through the interconnection network
Output Ports
• Buffering required when datagrams arrive from fabric faster than the transmission rate
• Scheduling discipline chooses among queued datagrams for transmission
Output port queueing
• buffering when arrival rate via switch exceeds output line speed
• queueing (delay) and loss due to output port buffer overflow!
Routing Algorithms
• The main function of the network layer is routing packets from the source machine to the destination machine.
• The routing algorithm is that part of the network layer software responsible for deciding which output line an incoming packet should be transmitted on.
• If the subnet uses virtual circuits internally, routing decisions are made only when a new virtual circuit is being set up.
• One can think of a router as having two processes inside it. – One of them handles each packet as it arrives, looking
up the outgoing line to use for it in the routing tables. This process is forwarding.
– The other process is responsible for filling in and updating the routing tables.
Routing: Metrics of Algorithms
• Graph abstraction for routing algorithms:
• graph nodes are routers
• graph edges are physical links– link cost: delay, $
cost, or congestion level
Goal: determine “good” path
(sequence of routers) thru network from source to
dest.
Routing protocol
A
ED
CB
F
2
2
13
1
1
2
53
5
• “good” path:– typically means
minimum cost path– other def’s possible
Routing: only two approaches used in practice
Global:• all routers have complete topology, link cost info• “link state” algorithms: use Dijkstra’s algorithm to
find shortest path from given router to all destinations
Decentralized: • router knows physically-connected neighbors, link
costs to neighbors• iterative process of computation, exchange of info
with neighbors• “distance vector” algorithms• a ‘self-stabilizing algorithm’ (we’ll see these later)
Routing: Shortest Path Routing
• This is a “Global” routing algorithm• The idea is to build a graph of the subnet,
with each node of the graph representing a router and each arc of the graph representing a communication line (often called a link).
• To choose a route between a given pair of routers, the algorithm just finds the shortest path between them on the graph.
Routing: Shortest Path Routing (Cont’d)
• Dijkstra's algorithm
Routing: Distance Vector Routing
• Distance vector routing algorithms operate by having each router maintain a table (i.e, a vector) giving the best known distance to each destination and which line to use to get there.
• These tables are updated by exchanging information with the neighbors.
• It was the original ARPANET routing algorithm and was also used in the Internet under the name RIP.
• each router maintains a routing table indexed by, and containing one entry for, each router in the subnet. This entry contains two parts: the preferred outgoing line to use for that destination and an estimate of the time or distance to that destination. The metric used might be number of hops, time delay in milliseconds, total number of packets queued along the path, or something similar.
Routing: Distance Vector Routing (Cont’d)
• An example of Distance Vector Routing
(a) A subnet. (b) Input from A, I, H, K, and the new routing table for J.
Question: How J computes its new route to router G?
Routing: Distance Vector Routing (Cont’d)
• The Count-to-Infinity Problem– In particular, it reacts rapidly to good
news, but leisurely to bad news.
(a) A gets Up (b) A turns Down
Routing: Hierarchical Routing
scale: with 200 million destinations:
• can’t store all dest’s in routing tables!
• routing table exchange would swamp links!
administrative autonomy
• internet = network of networks
• each network admin may want to control routing in its own network
Our routing review thus far - idealization • all routers identical• network “flat”… not true in practice
Routing: Hierarchical Routing (Cont’d)
• aggregate routers into regions, “autonomous systems” (AS)
• routers in same AS run same routing protocol– “intra-AS” routing
protocol– routers in different AS
can run different intra-AS routing protocol
• special routers in AS• run intra-AS routing
protocol with all other routers in AS
• also responsible for routing to destinations outside AS– run inter-AS routing
protocol with other gateway routers
gateway routers
Routing: Hierarchical Routing (Cont’d)
• An example of Hierarchical Routing
(a) the Topology of network (b) the Full table of 1A (c) the Hierarchical table of 1A
Intra-AS and Inter-AS routingGateways:
•perform inter-AS routing amongst themselves•perform intra-AS routers with other routers in their AS
inter-AS, intra-AS routing in
gateway A.c
network layer
link layer
physical layer
a
b
b
aaC
A
Bd
A.a
A.c
C.bB.a
cb
c
Intra-AS and Inter-AS routing
Host h2
a
b
b
aaC
A
Bd c
A.a
A.c
C.bB.a
cb
Hosth1
Intra-AS routingwithin AS A
Inter-AS routingbetween A and B
Intra-AS routingwithin AS B
Internet: OSPF, IS-IS, RIP
Internet: BGP
Addressing
• What’s an address?– identifier that differentiates between me and
someone else, and also helps route data to/from me
• Real world examples of addressing?– mailing address– office #, floor, etc– different “levels of addressing”
– Phone#
Addressing: network layer• IP address: 32-bit
identifier for host, router interface
• interface: connection between host, router and physical link– router’s typically have
multiple interfaces– host may have
multiple interfaces– IP addresses
associated with interface, not host, 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
223.1.1.1 = 11011111 00000001 00000001 00000001
223 1 11
IP Addressing• IP address:
– network part (high order bits)
– host part (low order bits)
• What’s a network ? (from IP address perspective)– device interfaces
with same network 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 IP networks(for IP addresses starting with 223, first 24 bits are network address)
LAN