Chapter 4 Network Layer Part 1 network layer

  • Slides: 28
Download presentation
Chapter 4 Network Layer Part 1: network layer overview datagram networks routers Computer Networking:

Chapter 4 Network Layer Part 1: network layer overview datagram networks routers Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009. Network Layer 4 -1

Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m

Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m network layer service models m forwarding versus routing m how a router works m routing (path selection) m dealing with scale m advanced topics: IPv 6, mobility r instantiation, implementation in the Internet Network Layer 4 -2

Chapter 4: Network Layer r 4. 1 Introduction r 4. 2 Virtual circuit and

Chapter 4: Network Layer r 4. 1 Introduction r 4. 2 Virtual circuit and datagram networks r 4. 3 What’s inside a router r 4. 4 IP: Internet Protocol m m Datagram format IPv 4 addressing ICMP IPv 6 r 4. 5 Routing algorithms m Link state m Distance Vector m Hierarchical routing r 4. 6 Routing in the Internet m m m RIP OSPF BGP r 4. 7 Broadcast and multicast routing Network Layer 4 -3

Network layer r transport segment from r r sending to receiving host on sending

Network layer r transport segment from r r sending to receiving host on sending side encapsulates segments into datagrams on rcving side, delivers segments to transport layer network layer protocols in every host, router examines header fields in all IP datagrams passing through it application transport network data link physical network data link physical network data link physical Network Layer application transport network data link physical 4 -4

Two Key Network-Layer Functions r forwarding: move packets from router’s input to appropriate router

Two Key Network-Layer Functions r forwarding: move packets from router’s input to appropriate router output r routing: determine route taken by packets from source to dest. m routing analogy: r routing: process of planning trip from source to dest r forwarding: process of getting through single interchange algorithms Network Layer 4 -5

Interplay between routing and forwarding Each router has a forwarding table Use a value

Interplay between routing and forwarding Each router has a forwarding table Use a value in a packet’s header to index into the table routing algorithm Corresponding value is the output link on which to place the packet local forwarding table header value output link 0100 0101 0111 1001 3 2 2 1 value in arriving packet’s header 0111 1 3 2 Network Layer 4 -6

Forwarding table r A routing algorithm is used to configure the table m Algorithm

Forwarding table r A routing algorithm is used to configure the table m Algorithm may be centralized and thus each router must download table m Algorithm my be decentralized and run in each router m In either case, router receives routing protocol messages that are used to configure the table Network Layer 4 -7

routers r Network level (layer 3): packet switch transfers a packet from the input

routers r Network level (layer 3): packet switch transfers a packet from the input link interface to the output link interface according to a value in a field in the header of the network-layer packet r Link-layer switches (layer 2): base their decision on values in the fields in the link-layer frame. r Routers are network level but must also act as link -layer switch since they are physically connected to another device Network Layer 4 -8

Connection setup r 3 rd important function in some network architectures: ATM (asynchronous transfer

Connection setup r 3 rd important function in some network architectures: ATM (asynchronous transfer mode), frame relay, X. 25 m Not in the web! r before datagrams flow, two end hosts and intervening routers establish virtual connection m routers get involved r network vs transport layer connection service: m network: between two hosts (may also involve intervening routers in case of VCs) m transport: between two processes m Network Layer 4 -9

Datagram networks r no call setup at network layer r routers: no state about

Datagram networks r no call setup at network layer r routers: no state about end-to-end connections m no network-level concept of “connection” r packets forwarded using destination host address m packets between same source-dest pair may take different paths application transport network data link 1. Send data physical application transport 2. Receive data network data link physical Network Layer 4 -10

Datagram networks r Each router still has forwarding table r Table only matches destination

Datagram networks r Each router still has forwarding table r Table only matches destination address to link interface. r When packet arrives at router, router uses dest addr to index into the forwarding table & determine output interface r Then forwards packet to that interface r Table is changed very slowly by a routing algorithm (typically 1 to-5 minutes!) application transport network data link 1. Send data physical application transport 2. Receive data network data link physical Network Layer 4 -11

Forwarding table Assume 32 -bit addresses: 4 billion possible entries That’s a big table!

Forwarding table Assume 32 -bit addresses: 4 billion possible entries That’s a big table! Destination Address Range 11001000 00010111 00010000 through 11001000 00010111 1111 Link Interface Group addresses 0 11001000 00010111 00011000 0000 through 11001000 00010111 00011000 1111 1 11001000 00010111 00011001 0000 through 11001000 00010111 00011111 2 otherwise 3 Network Layer 4 -12

Longest prefix matching Prefix Match 11001000 00010111 00010 11001000 00010111 00011000 11001000 00010111 00011

Longest prefix matching Prefix Match 11001000 00010111 00010 11001000 00010111 00011000 11001000 00010111 00011 otherwise Link Interface 0 1 2 3 Examples DA: 11001000 00010111 00010110 10100001 Which interface? DA: 11001000 00010111 00011000 1010 Which interface? Problem: address may match two or more table entries: the second DA matches both second and third entries Resolution: use the longest match Network Layer 4 -13

Datagram or VC network: why? Internet (datagram) r data exchange among computers ATM (VC)

Datagram or VC network: why? Internet (datagram) r data exchange among computers ATM (VC) r evolved from telephony “elastic” service, no strict r human conversation: timing req. m strict timing, reliability r “smart” end systems (computers) requirements m can adapt, perform control, m need for guaranteed error recovery service m simple inside network, complexity at “edge” r “dumb” end systems r many link types m telephones m different characteristics m complexity inside m uniform service difficult network r Easy to implement new r Hard to implement new application level service: just service: must update every define new protocol in host router! devices! m Network Layer 4 -14

Chapter 4: Network Layer r 4. 1 Introduction r 4. 2 Virtual circuit and

Chapter 4: Network Layer r 4. 1 Introduction r 4. 2 Virtual circuit and datagram networks r 4. 3 What’s inside a router r 4. 4 IP: Internet Protocol m m Datagram format IPv 4 addressing ICMP IPv 6 r 4. 5 Routing algorithms m Link state m Distance Vector m Hierarchical routing r 4. 6 Routing in the Internet m m m RIP OSPF BGP r 4. 7 Broadcast and multicast routing Network Layer 4 -15

Router Architecture Overview Two key router functions: Forwarding is the same as switching r

Router Architecture Overview Two key router functions: Forwarding is the same as switching r run routing algorithms/protocol (RIP, OSPF, BGP) r forwarding datagrams from incoming to outgoing link forwarding Data plane (hardware) Routing management Control plane (software) PCI bus from processor to input ports Network Layer 4 -16

Routing processor r Executes routing protocols r Maintains routing tables and attached link state

Routing processor r Executes routing protocols r Maintains routing tables and attached link state information r Computes the forwarding table for the router r Performs network management functions. r These functions operate at the millisecond or second timescale, so can be implemented in software Network Layer 4 -17

Router forwarding plane r The input ports, output ports, and switching fabric together are

Router forwarding plane r The input ports, output ports, and switching fabric together are implemented in hardware and are called the router forwarding plane r why implement these functions in hardware? m 10 Gbps input link, 64 -byte IP datagram m Input link has 51. 2 ns to process the datagram before another one arrives m If N input ports are on a line card (common), must operate N times faster Network Layer 4 -18

Input Port Functions Physical layer: bit-level reception Data link layer: e. g. , Ethernet

Input Port Functions Physical layer: bit-level reception Data link layer: e. g. , Ethernet see chapter 5 Note: port here is a physical port. Different from the software ports used with sockets. Decentralized switching: r given datagram dest. , lookup output port using forwarding table in input port memory r Network control packets sent to the processor r goal: complete input port processing at ‘line speed’ r queuing: if datagrams arrive faster than forwarding rate into switch fabric Network Layer 4 -19

Input Port Functions r Input ports have small memory to contain forwarding table (uses

Input Port Functions r Input ports have small memory to contain forwarding table (uses cache) r Output port lookup must be very fast; linear search is too slow! r Packet may have to be queued if switching fabric is busy r Other actions m m m Physical and link-layer processing Packet’s version number, checksum and time-to-live fields must be checked and latter two rewritten Counters used for network management (e. g. , number of datagrams received) must be updated. Network Layer 4 -20

Three types of switching fabrics Network Layer 4 -21

Three types of switching fabrics Network Layer 4 -21

Switching Via Memory First generation routers: r traditional computers with switching under direct control

Switching Via Memory First generation routers: r traditional computers with switching under direct control of CPU r packet copied to system’s memory r speed limited by memory bandwidth (2 bus crossings per datagram) Input Port Memory Output Port System Bus Single bus/input/output port limits throughput Network Layer 4 -22

Switching Via a Bus r datagram from input port memory to output port memory

Switching Via a Bus r datagram from input port memory to output port memory via a shared bus (processor not used) m m Input port pre-pends an internal header to indicate output port Label removed at output port before sending r bus contention: switching speed limited by bus bandwidth; only one packet can be on bus at a time r 32 Gbps bus, Cisco 5600: sufficient speed for access and enterprise routers Network Layer 4 -23

Switching Via An Interconnection Network r overcome bus bandwidth limitations r Banyan networks, other

Switching Via An Interconnection Network r overcome bus bandwidth limitations r Banyan networks, other interconnection nets initially developed to connect processors in multiprocessor m m m All input ports have lines to all output ports Switching fabric can selectively open connections Still possible to have contention: two input ports trying to connect to the same output port r advanced design: fragmenting datagram into fixed length cells, switch cells through the fabric. r Cisco 12000: switches 60 Gbps through the interconnection network Network Layer 4 -24

Output Ports r Buffering required when datagrams arrive from fabric faster than the transmission

Output Ports r Buffering required when datagrams arrive from fabric faster than the transmission rate r Scheduling discipline chooses among queued datagrams for transmission Network Layer 4 -25

Output port queueing r buffering when arrival rate via switch exceeds output line speed

Output port queueing r buffering when arrival rate via switch exceeds output line speed r queueing (delay) and loss due to output port buffer overflow! Network Layer 4 -26

How much buffering? r RFC 3439 rule of thumb*: average buffering equal to “typical”

How much buffering? r RFC 3439 rule of thumb*: average buffering equal to “typical” RTT (say 250 msec) times link capacity C m e. g. , C = 10 Gps link: 2. 5 Gbit buffer r Recent recommendation**: with N flows, buffering equal to RTT. C N *based on an analysis of queueing dynamics of a relatively small number of TCP flows (Villamizar 1994) **based on theoretical and experiments on large flows (Appenzeller 2004) Network Layer 4 -27

Input Port Queuing r Fabric slower than input ports combined -> queueing may occur

Input Port Queuing r Fabric slower than input ports combined -> queueing may occur at input queues r Head-of-the-Line (HOL) blocking: queued datagram at front of queue prevents others in queue from moving forward r queueing delay and loss due to input buffer overflow! Can occur when packet arrival rate reaches 58% of capacity! There are solutions…beyond the scope of this class! Network Layer 4 -28