Network Layer —— the core of networking. The Network Core mesh of interconnected routers the...

37
Network Layer —— the core of networking

Transcript of Network Layer —— the core of networking. The Network Core mesh of interconnected routers the...

Page 1: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

Network Layer

—— the core of networking

Page 2: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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”

Page 3: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 4: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 5: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 6: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 7: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 8: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 9: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 10: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 11: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 12: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

Datagram or VC network

Page 13: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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.

Page 14: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

Router Architecture Overview

Two key router functions: • run routing algorithms/protocol• forwarding datagrams from incoming to outgoing link

Page 15: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 16: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

Three types of switching fabrics

Page 17: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 18: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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)

Page 19: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 20: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

Output Ports

• Buffering required when datagrams arrive from fabric faster than the transmission rate

• Scheduling discipline chooses among queued datagrams for transmission

Page 21: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

Output port queueing

• buffering when arrival rate via switch exceeds output line speed

• queueing (delay) and loss due to output port buffer overflow!

Page 22: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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.

Page 23: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 24: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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)

Page 25: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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.

Page 26: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

Routing: Shortest Path Routing (Cont’d)

• Dijkstra's algorithm

Page 27: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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.

Page 28: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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?

Page 29: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 30: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 31: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 32: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 33: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 34: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 35: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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#

Page 36: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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

Page 37: Network Layer —— the core of networking. The Network Core  mesh of interconnected routers  the fundamental question: how is data transferred through.

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