network cscd 330 superhighway network ... -...

63
1 CSCD 330 Network Programming Winter 2020 Lecture 13 Network Layer Reading: Chapter 4 Some slides provided courtesy of J.F Kurose and K.W. Ross, All Rights Reserved, copyright 1996-2007 Network Superhighway

Upload: others

Post on 17-Mar-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

1

CSCD 330Network Programming Winter 2020

Lecture 13Network Layer

Reading: Chapter 4

Some slides provided courtesy of J.F Kurose and K.W. Ross, All Rights Reserved, copyright 1996-2007

Network Superhighway

Page 2: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

2

Introduction• So far, have looked at

• Application Layer

• Transport Layer

• Now, move down protocol stack to

• Network Layer• What services are offered?

• How does this layer fit with other layers?

• Hardware is used at this layer?

Page 3: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

3

Network Layer

Goals• Understand principles behind network layer

• Network layer service models

• Forwarding versus routing, difference

• How a router works - Internally

• Routing itself

• Addresses, paths, algorithms

Page 4: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

TCP/IP Model

4

We areHere

Network

Data Link

Transport

Appliction

Page 5: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

5

Routing in the Internet

Page 6: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

6

Hierarchical Routing - Solution

• Internet is huge, distributed system managed by mostly private, possibly competing corporations

• Each corporate entity is responsible for their own routing within their IP space

• So, they aggregate routers into regions ...

Autonomous Systems (AS) • Routers in same AS run same routing protocol

Page 7: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

7

Autonomous System (AS)

• What is an Autonomous System?• Within Internet, an AS is

• Unit of router policy, either single network or group of networks controlled by common network administrator

• On behalf of single administrative entity• An autonomous system is assigned globally unique

number, sometimes called an Autonomous System Number (ASN)

• Report of current numbers http://www.cidr-report.org/as2.0/autnums.html

Page 8: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

Routing Within and Between AS's

AS 123

AS 45

AS 678

Page 9: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

Autonomous Systems

Example AS’s

AS # Provider 701 UUnet (U.S. ) (AS 701-705)

1239 Sprintlink U.S. Domestic

3356 Level 3

7018 AT&T WorldNet

209 Qwest

3935 Eastern Washington University

. . . .9

Page 10: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

Autonomous Systems• Have Routing policy for each AS

• Can decide what routing algorithms to use• Typical to have different routing algorithms

• Interior to the AS• Interior Gateway Protocols (IGP's)

• Exterior networks between AS's• Exterior Gateway Protocols (EGP's)

Page 11: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

11

Network Layer

• Diagram shows at end points entire protocol stack implemented

• Need transport and applications layers for processes

• Routers only need layers up through network layer

• Data Link• Network

applicationtransportnetworkdata linkphysical

application

transportnetworkdata linkphysical

networkdata linkphysical network

data linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysicalnetwork

data linkphysical

Differences Network vs. Transport

Page 12: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

12

Two Key Network-Layer Functions

• Forwarding• Move packets from router’s input queues to

router's output queues• Movement contained within one router

• Routing• Determine routing for packets from source to destination

•Routing algorithms important in efficiently routing packets•Movement of packets is distributed

Page 13: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

Routing vs. Forwarding

Analogy

You take a road trip across country, go through many highway interchanges

• Routing: Process of planning trip from source to destination

• Forwarding: Process of getting through single interchange

Page 14: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

How Routing Works …

• Every router has Forwarding Table

• Also called a Routing Table

• Router forwards packets by examining value in arriving packet header

– Destination IP Address

• Uses value to index into router’s forwarding table

• See following slide …14

Page 15: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

15

1

23

0111

Destination value in packet’s header

routing algorithm

local forwarding tableheader value output link

0100010101111001

3221

Interplay between Routing and Forwarding

All routers have routing tables

Specify next hop in route

Create Routing Table

Built by routing algorithms

Page 16: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

16

IP Datagram Delivery

Ethernet

TokenRingLANEthernet

H1

R1 R2

R3 R4

H2

Network ofEthernetswitches

Point-to-point link Point-to-point link

IP

• View at Data link Layer • Internetwork collection of LANs or point-to-point links or

switched networks that are connected by routers

Ted

Ed

Page 17: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

17

H1

R1 R2

R3 R4

H2

10.2.1.0/24

20.1.0.0/1610.1.2.0/24

10.1.0.0/24 10.3.0.0/16

20.2.1.0/28

IP Datagram Delivery

IP

• View at IP Layer• An IP network is a logical entity with a network number

• We represent an IP network as a “cloud”

• The IP delivery service takes the view of clouds, and ignores

data link layer view

Page 18: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

18

Routing tables• Each router keeps a routing table tells the router how to process an

outgoing packet• Main columns

– Destination address: Where is IP datagram going to?– Next hop: What route is best to send IP datagram?– Interface: What is the output port?

• Routing tables help datagrams gets closer to their destination Routing table unique for each router

directdirectR4direct R4R4

NextHop

eth0eth0serial0eth1eth0eth0

interface

10.1.0.0/2410.1.2.0/2410.2.1.0/2410.3.1.0/2420.1.0.0/1620.2.1.0/28

Destination

IP datagrams can be directly delivered (“direct”) to connected networks or sent to another router (“R4”)

Routing Table Example

Page 19: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

19

Delivery with routing tables

D e s t i n a t i o n N e x t H o p 1 0 . 1 . 0 . 0 / 2 4 1 0 . 1 . 2 . 0 / 2 4 1 0 . 2 . 1 . 0 / 2 4 1 0 . 3 . 1 . 0 / 2 4 2 0 . 1 . 0 . 0 / 1 6 2 0 . 2 . 1 . 0 / 2 8

d i r e c t R 3 R 3 R 3 R 3 R 3

H 1

R 1 R 2

R 3 R 4

H 2

1 0 . 2 . 1 . 0 / 2 4

2 0 . 1 . 0 . 0 / 1 61 0 . 1 . 2 . 0 / 2 4

1 0 . 1 . 0 . 0 / 2 4 1 0 . 3 . 0 . 0 / 1 6

2 0 . 2 . 1 . 0 / 2 8

2 0 . 2 . 1 . 2 / 2 8

D e s t i n a t i o n N e x t H o p 1 0 . 1 . 0 . 0 / 2 4 1 0 . 1 . 2 . 0 / 2 4 1 0 . 2 . 1 . 0 / 2 4 1 0 . 3 . 1 . 0 / 2 4 2 0 . 1 . 0 . 0 / 1 6 2 0 . 2 . 1 . 0 / 2 8

d i r e c t d i r e c t R 4 d i r e c t R 4 R 4

D e s t i n a t i o n N e x t H o p 1 0 . 1 . 0 . 0 / 2 4 1 0 . 1 . 2 . 0 / 2 4 1 0 . 2 . 1 . 0 / 2 4 1 0 . 3 . 1 . 0 / 2 4 2 0 . 1 . 0 . 0 / 1 6 2 0 . 2 . 1 . 0 / 2 8

R 3 R 3 R 2 d i r e c t d i r e c t R 2

D e s t i n a t i o n N e x t H o p 1 0 . 1 . 0 . 0 / 2 4 1 0 . 1 . 2 . 0 / 2 4 1 0 . 2 . 1 . 0 / 2 4 1 0 . 3 . 1 . 0 / 2 4 2 0 . 2 . 0 . 0 / 1 6 3 0 . 1 . 1 . 0 / 2 8

R 3 d i r e c t d i r e c t R 3 R 2 R 2

D e s t i n a t i o n N e x t H o p 1 0 . 1 . 0 . 0 / 2 4 1 0 . 1 . 2 . 0 / 2 4 1 0 . 2 . 1 . 0 / 2 4 1 0 . 3 . 1 . 0 / 2 4 2 0 . 1 . 0 . 0 / 1 6 2 0 . 2 . 1 . 0 / 2 8

R 1 R 1 d i r e c t R 4 d i r e c t d i r e c t

D e s t i n a t i o n N e x t H o p 1 0 . 1 . 0 . 0 / 2 4 1 0 . 1 . 2 . 0 / 2 4 1 0 . 2 . 1 . 0 / 2 4 1 0 . 3 . 1 . 0 / 2 4 2 0 . 1 . 0 . 0 / 1 6 2 0 . 2 . 1 . 0 / 2 8

R 2 R 2 R 2 R 2 R 2 d i r e c t

to:20.2.1.2

Page 20: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

Two Service Models at Network Layer• What services could network layer provide?

• Guarantee delivery,

• Guarantee bandwidth,

• Order packets,

• Time delay guarantee …

• Given what you know of the Network layer, are any of these services implemented?

No!

• Decided that network only does best effort delivery!!

20

Page 21: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

Two Service Models at Network Layers• Recall, we discussed Circuit Switched Network and

Datagram Network

• However, you can try to emulate these services in network layer virtually

• Datagram service is what we typically have1. Datagram service – best effort, no previous connection setup

• Virtual service model lets you obtain services other than best effort

2. Virtual Service – tries to compensate for lack of guaranteed service, sets up connections ahead of time

Examples: ATM, Asynchronous Transfer Mode 21

Page 22: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

22

Datagram Service

• Connectionless Unacknowledged Network Service• Attitude to packets Characterized by

• “Send and forget!”• Does not guarantee actual delivery• Does not guarantee data is undamaged• Does not guarantee data delivered in

order• Does not guarantee that only one copy of

the data will be delivered

Page 23: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

23

Virtual Service

• Call setup, teardown for each call before data can flow

• Each packet carries Virtual Circuit (VC) identifier, VC25, VC601

– Not same as destination host address• Every router on source-destination path

maintains “state” for each passing connection

• Sets Up ... Source-to-destination path ahead of time

• Uses that route to send all packets• Behaves much like telephone circuit

Page 24: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

Virtual Service

• Book discusses mechanics of a generic virtual service , Section 4.2

• Have virtual identifiers instead of IP addresses

• Can run a virtual service over the Internet

• Routers must recognize the virtual identifiers

Two Examples: ATM and MPLS

Asynchronous Transfer Mode http://www2.rad.com/networks/infrastructure/atm/main.htm

Multiprotocol Label Switching http://www2.rad.com/networks/infrastructure/ipmpls/main.htm

Page 25: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

25

Datagram Networks Basics

• No call setup at network layer

• Routers: No state about end-to-end connections• No network-level concept of “connection”

• Packets forwarded using destination host address• Packets between same source-dest pair may take different paths

application

transportnetworkdata linkphysical

applicationtransportnetworkdata linkphysical

1. Send data 2. Receive data

Page 26: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

Datagram Networks

• No advance setup of paths, link to link connections

• Need a global number recognized by all network components, hosts and routers

• How would you set up routing tables in order to accommodate … currently, over 4 billion entries?

• Question: Whats the best way to do this?

26

Page 27: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

Routing Table Organization

• One dumb idea, global table 4 billion entries

• 232

• But … didn't do that

• IP addresses assigned contiguous address blocks by region

• So, can use a matching algorithm and match the network prefix to route packets

• Have distributed address space

• More on addressing later ...27

Page 28: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

Routers

28

Page 29: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

Routers Internals

• Routers are the “glue” that holds the Internet together

• Router speeds greatly affect how well traffic gets moved around the network

• Performance of routers turns out to be critical

• Today, look at evolution of routers and the speedups that have occurred

Page 30: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

Routers Commercial Realities

• A router is sold as one big box• Cisco, Juniper, Redback, Avici, …• No standard interfaces between components• Cisco switch, Juniper cards, and Avici software

• Vendors vs. Service providers• Vendors: Build the routers and obey standards• Providers: Buy the routers and configure them

EWU is a provider

Page 31: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

31

Routing Architectures

Routing Processor

Switching Fabric

A Router Consists of Ports Connections to wires to other

network entities

Switching fabric A “network” inside the router that

transfers packets between ports

Routing processor Brain of the router ...Maintains

lookup (routing) tables

ports

Page 32: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

32

Router Architecture Overview

Routers do two important things• Build and Maintain Routing Tables

• Performs Packet Switching and Updating

Several input ports

Several output ports

Page 33: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

33

Generic Router Architecture

LookupIP Address

UpdateHeader

Header ProcessingData Hdr Data Hdr

1M prefixesOff-chip DRAM

AddressTable

AddressTable

IP Address Next Hop

QueuePacket

BufferMemory

BufferMemory

1M packetsOff-chip DRAM

Page 34: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

34

Input Port Functions

Input Port Function: • Given datagram destination lookup output

port using forwarding table in input port memory

Physical layer:bit-level reception

Data link layer:EthernetProcess packetup to network layer

Page 35: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

35

Input Port Functions

• Needs to perform lookup at line speed• Gbps in most networks

Example:• OC-48 link – runs at 2.5 Gbps

• (OC) Optical Carrier – SONET fiber optic network, different sizes

• If packets are 256 bytes – small packet

• Must lookup speeds of 1 Million lookups/sec

• Binary search typically done to speed things up

• Uses special tree structures, Trie trees

• And other methods ... more later

Page 36: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

36

Switching Fabrics

• Switching fabric is heart of a router• Through switching that datagrams are actually moved

from an input port to an output port

• Switching can be accomplished in a number of ways ...

Page 37: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

37

Three types of switching fabrics

1. 2.

3.

Relate to Router Evolution

Page 38: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

38

1st Generation, Switching Via Memory

First Generation Routers Traditional computers with switching under direct control of CPU, act as router Packet copied to system’s memory Speed limited by Memory Bandwidth

InputPort

OutputPort

Memory

System Bus

CISCO Catalyst 8500's

Page 39: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

39

1st Generation Routers

• This architecture is still used in low end routers

• Arriving packets are copied to main memory via direct memory access (DMA)

• Backplane (shared bus)• All IP forwarding functions are

performed in central processor. • Routing cache at processor can

accelerate the routing table lookup

• Drawbacks:– Forwarding Performance is

limited by CPU– Capacity of shared bus limits

the number of interface cards that can be connected

Page 40: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

40

RouteTableCPU Buffer

Memory

LineInterface

MAC

LineInterface

MAC

LineInterface

MAC

Typically <0.5Gb/s aggregate capacity

Shared Bus

Line Interface

CPU

Memory

First Generation Routers

Off-chip BufferOne route table

Page 41: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

41

First GenerationSwitching via Memory

• Comment• Modern routers also switch via memory

• Difference from early routers

• Address lookup and packet switching in memory

• Performed by processors on input line cards

• Greatly speeds things up !!!!

• Leads us to the next generation ...

Page 42: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

42

2nd Generation Routers

• Keeps shared bus architecture,

but offloads most IP forwarding to interface cards

• Interface cards have local route cache and processing elements

• Greatly speeds up packet processing

Fast path: If routing entry is found in local cache, forward packet directly to outgoing interface

Slow path: If routing table entry is not in cache, packet must be handled by central CPU

• Drawbacks: Shared bus is still

bottleneck

Page 43: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

43

2nd GenerationSwitching Via a Bus

• Use Shared Bus• Less intervention by routing processor

Since bus is shared• Only one packet at a time can be transferred over bus• And since every packet must cross bus, switching

bandwidth of router limited to bus speed

Bus contention: Switching speed limited by bus bandwidth, one packet at a time

• Example: 1 Gbps bus, Cisco 1900

OK … for access and enterprise routers• Not regional or backbone

Page 44: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

44

RouteTableCPU

LineCard

BufferMemory

LineCard

MAC

BufferMemory

LineCard

MAC

BufferMemory

FwdingCache

FwdingCache

FwdingCache

MAC

BufferMemory

Typically <5Gb/s aggregate capacity

Second Generation Routers

Shared bus

Buffer Memory

Page 45: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

45

Third GenerationCrossbar Switch

• A crossbar switch is a matrix of switches between inputs and outputs

• Overcomes bandwidth limitation of single, shared bus

• More sophisticated interconnection network

• Used in past to interconnect processors in multiprocessor computer architectures

Page 46: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

46

Crossbar Switch Improvements Crossbar switch enables high performance for two reasons:

First, connections from line cards to central switch are now simple point-to-point links

Operate at very high speed. Semiconductor companies have developed chip-to-chip serial links operating at over 1 Gbps

Second, can support multiple bus transactions simultaneously – Parallelizing the process

This greatly increases aggregate bandwidth of the system

Page 47: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

47

Crossbar Switch• How it works

• Consists of 2N buses• Connect - N Input ports to N Output ports

• Packet arrives at input port travels along horizontal bus attached to input port until it intersects with vertical bus leading to desired output port

• Key idea – parallel processing of packets• If vertical bus leading to output port is free

Packet is transferred to output port• Else If vertical bus is in use to transfer packet from another input

port to same output port, Arriving packet is blocked and must be queued at the input port … More on queuing later …

Paper on routershttp://www.cs.cmu.edu/~srini/15-744/F02/readings/McK97.html

Page 48: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

48

Third Generation Routers

LineCard

MAC

LocalBuffer

Memory

CPUCard

LineCard

MAC

LocalBuffer

Memory

“Crossbar”: Switched Backplane

Line Interface

CPU

Memory

FwdingTable

RoutingTable

FwdingTable

Typically <50Gb/s aggregate capacity

Page 49: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

49

Output Ports

• Output Port Processing• Datagrams then stored in output port's memory,

transmits them over outgoing link

• Queuing and buffer management needed when switch fabric delivers packets to output port at a rate that exceeds output link rate

• Cover output port queuing below

Page 50: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

50

Output Ports

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

• Scheduling algorithm chooses among queued datagrams for transmission

• Can be simple FIFO or some fairness algorithm based on destination packet distribution

encapsulation

Here is where many packets get dropped

Page 51: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

Where Does Packet Queue Occur?

• Consider That ... • Packet queues can form at both input ports and

output ports

• As queues grow large, router's buffer space will eventually be exhausted

• Packet loss will occur!!!

Page 52: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

Input and Output Queues

• Question of Speeds

• Suppose that input line speeds and output line speeds are all identical,

• With n input ports and n output ports

• If switching fabric speed is at least n times as fast as the input line speed,

• Will queues form at input ports?

• NO.

Page 53: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

Input and Output Queues• What about output ports?

• Worst case, packets arrive at each n input ports will be destined to same output port

• In time it takes to receive (or send) a packet, n packets will arrive at this output port

• Since output port can only transmit a single packet in a unit of time (the packet transmission time), n arriving packets will have to queue (wait) for transmission over the outgoing link

Page 54: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

Input and Output Queues• If switch fabric is not fast enough to transfer all arriving

packets through fabric without delay, then packet queuing will also occur at input ports

• If two packets at front of two input queues are destined to same output queue, then one packet will be blocked and must wait at input queue -

Page 55: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

Input and OutputQueues

• This phenomenon is known as

• Head-of-the-line (HOL) blocking • On an input-queued switch

• Queued packet in an input queue must wait for transfer through fabric due to blocking of another packet at head-of-the-line

• What would be one solution?

Page 56: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

56

Solution: Virtual Output Queues

• Maintain N virtual queues at each input– one per output

Output 1

Output 2

Output 3

Input 1

Input 2

Input 3

Page 57: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

57

Router Lookup Speedups

Page 58: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

58

Summary of Routing Functionality

• Router gets packet

• Looks at packet header for destination

• Looks up routing table for output interface

• Modifies header (TTL, IP header checksum)

• Passes packet to output interface

• Routers have special hardware to

assist with processing

Page 59: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

59

Content Addressable Memory• CAM special type of computer memory • Certain high speed searching applications

• Utilizes hardware-based search-table provide higher performance alternative to software-based searching algorithms

• CAM can be compared to inverse of RAM• RAM given address, produces data

• CAM given data word, produces an address, if data word is found in memory

• CAM much faster than RAM – entire memory search in one clock cycle

• CAM is very expensive compared to RAM – because additional comparison circuitry is required for every bit to match stored bits with input bits

Page 60: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

60

CISCO Express Forwarding

Page 61: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

61

Cisco Express Forwarding The two major components of CEF are

Forwarding Information Base (FIB) and the Adjacency Table Maintained in each router line card

FIB table is an exact replica of the routing table ... additions or deletions in routing table - changed on the FIB table

FIB table consists of four levels of hierarchy to correspond with 4 bytes of an IPv4 address

Avoids using main CPU to process packet Adjacency table maps Layer 2 MAC addresses to

associated Layer 3 IP addresses Avoids need for ARP table lookup Combination of two tables allows for packets to be switched

at a much higher rate

Page 62: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

62

Summary

• Multiple things can be done to enhance router performance• Input cards

• Have own CPU processors• Use caches for address lookup• Have copies of routing tables

• Switch fabric

Cross Switches faster - parallelism to switch packets

Page 63: Network CSCD 330 Superhighway Network ... - penguin.ewu.edupenguin.ewu.edu/cscd330/CourseNotes/CSCD330... · 18 Routing tables • Each router keeps a routing table tells the router

63

Reading: Chapter 4 - Network Layer