Presentation is loading. Please wait.

Presentation is loading. Please wait.

Network Layer4-1 Chapter 4 Network Layer Part 1: network layer overview datagram networks routers Computer Networking: A Top Down Approach 6 th edition.

Similar presentations


Presentation on theme: "Network Layer4-1 Chapter 4 Network Layer Part 1: network layer overview datagram networks routers Computer Networking: A Top Down Approach 6 th edition."— Presentation transcript:

1 Network Layer4-1 Chapter 4 Network Layer Part 1: network layer overview datagram networks routers Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

2 Network Layer4-2 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: IPv6, mobility r instantiation, implementation in the Internet

3 Network Layer4-3 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 Datagram format m IPv4 addressing m ICMP m IPv6 r 4.5 Routing algorithms m Link state m Distance Vector m Hierarchical routing r 4.6 Routing in the Internet m RIP m OSPF m BGP r 4.7 Broadcast and multicast routing

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

5 Network Layer4-5 Network layer 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 application transport network data link physical application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical

6 Network Layer4-6 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 algorithms analogy: r routing: process of planning trip from source to dest r forwarding: process of getting through single interchange

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

8 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 Layer4-8

9 routers r Network level (layer 3): packet switch m transfers a packet from the input link interface to the output link interface m according to a value in a field in the header of the network-layer packet r Link-layer (layer 2): switches m 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 Layer4-9

10 Network Layer4-10 Connection setup r 3 rd important function in some network architectures: m ATM (asynchronous transfer mode), frame relay, X.25 r before datagrams flow, two end hosts and intervening routers establish virtual connection m routers get involved

11 Network Layer4-11 Network service model Q: What service model for “channel” transporting datagrams from sender to receiver? Example services for individual datagrams: r guaranteed delivery r guaranteed delivery with bounded delay (say less than 40 msec delay) Example services for a flow of datagrams: r in-order datagram delivery r guaranteed minimum bandwidth to flow (acts like transport layer): m if bit rate is below specified rate, guarantee delivery within specified delay

12 Network Layer4-12 Network service model Q: What service model for “channel” transporting datagrams from sender to receiver? Example services for individual datagrams: r guaranteed delivery r guaranteed delivery with bounded delay (say less than 40 msec delay) Example services for a flow of datagrams: r guaranteed max jitter. i.e., restrictions on changes in inter-packet spacing r security services. Network layer could encrypt the payloads of all datagrams sent to destination host. m Source and destination know a secret session key r …and other services!

13 Network Layer4-13 Network layer service models: Network Architecture Internet ATM Service Model best effort* CBR VBR ABR UBR Bandwidth none constant rate guaranteed rate guaranteed minimum none Loss no yes no Order no yes Timing no yes no Congestion feedback no (inferred via loss) no congestion no congestion yes no Guarantees ? CBR: constant bit rate ATM network service VBR: variable bit rate ATM network service ABR: available bit rate ATM network service UBR: unspecified bit rate ATM network service * i.e., no service at all! A network that delivered no packets would meet this requirement!

14 ATM networks r Constant bit rate (CBR) ATM network service m Goal: provide a flow of packets (known as cells) with a virtual pipe m whose properties are the same as if a dedicated fixed- bandwidth transmissions link existed between source and destination hosts. r Available bit rate (ABR) ATM network service m Slightly-better-than-best-effort-service m Cells may be lost, but cannot be reordered and a minimum transmission rate is guaranteed. m Can provide congestion feedback to transport layer Network Layer4-14

15 Network Layer4-15 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 Datagram format m IPv4 addressing m ICMP m IPv6 r 4.5 Routing algorithms m Link state m Distance Vector m Hierarchical routing r 4.6 Routing in the Internet m RIP m OSPF m BGP r 4.7 Broadcast and multicast routing

16 Network Layer4-16 Network layer connection and connection-less service r datagram network provides network-layer connectionless service m Used for the internet r VC (Virtual-Circuit) network provides network-layer connection service m Used for some DSL services m Mostly deployed by telephone companies m Mostly used to access internet today m In 90’s was “next big thing”

17 Network Layer4-17 Network layer connection and connection-less service r VC network is analogous to the transport- layer services, but: m service: host-to-host instead of process-to- process m no choice: network provides connection- oriented or connectionless but cannot provide both m implementation: in network core (in the routers) transport-layer connection service is only in the edges (hosts).

18 Network Layer4-18 Virtual circuits network-layer connections r call setup, teardown for each call before data can flow r each packet carries VC identifier (not destination host address) r every router on source-dest path maintains “state” for each passing connection r link, router resources (bandwidth, buffers) may be allocated to VC (dedicated resources = predictable service) “source-to-dest path behaves much like telephone circuit” m performance-wise m network actions along source-to-dest path

19 Network Layer4-19 VC implementation a VC consists of: 1. path from source to destination (a series of links and routers) 2. VC numbers, one number for each link along path 3. entries in forwarding tables in routers along path r packet belonging to VC carries VC number (rather than dest address) r VC number can be changed on each link. m New VC number comes from forwarding table

20 Network Layer4-20 Forwarding table 12 22 32 1 2 3 VC number interface number Incoming interface Incoming VC # Outgoing interface Outgoing VC # 1 12 3 22 2 63 1 18 3 7 2 17 1 97 3 87 … … Forwarding table in northwest router: Routers maintain connection state information! Network decides on path for this VC: A-R1-R2-B and assigns VC numbers 12, 22, 32 to the links.

21 Virtual Circuits r Why not keep same VC number for all links? m Replacing the number keeps the VC number field small m VC setup is simplified Each router can choose a different number Otherwise would have to coordinate the number across all routers on the path Network Layer4-21

22 Virtual Circuits r Three phases in VC m VC setup. Network layer software does: Determines path (series of links and routers) Determines VC number for each link along path Adds entry in the forwarding table in each router May reserve resources along path (e.g., bandwidth) m Data transfer. Packets flow. m VC teardown. Initiated by sender or receiver. Network informs other side of shutdown Update forwarding tables of all routers on path Network Layer4-22

23 Network Layer4-23 Virtual circuits: signaling protocols r used to setup, maintain teardown VC r used in ATM, frame-relay, X.25 r not used in today’s Internet application transport network data link physical application transport network data link physical 1. Initiate call 2. incoming call 3. Accept call 4. Call connected 5. Data flow begins 6. Receive data We’re not covering signaling protocols!

24 Network Layer4-24 Datagram networks (internet) 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 physical application transport network data link physical 1. Send data 2. Receive data

25 Network Layer4-25 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 physical application transport network data link physical 1. Send data 2. Receive data

26 Network Layer4-26 1 2 3 Datagram forwarding table IP destination address in arriving packet’s header routing algorithm local forwarding table dest address output link address-range 1 address-range 2 address-range 3 address-range 4 32213221 4 billion IP addresses (in 32 bits), so rather than list individual destination address list range of addresses (aggregate table entries)

27 Network Layer4-27 Destination Address Range 11001000 00010111 00010000 00000000 through 11001000 00010111 00010111 11111111 11001000 00010111 00011000 00000000 through 11001000 00010111 00011000 11111111 11001000 00010111 00011001 00000000 through 11001000 00010111 00011111 11111111 otherwise Link Interface 0 1 2 3 Q: but what happens if ranges don’t divide up so nicely? Datagram forwarding table

28 Network Layer4-28 Longest prefix matching Destination Address Range 11001000 00010111 00010*** ********* 11001000 00010111 00011000 ********* 11001000 00010111 00011*** ********* otherwise DA: 11001000 00010111 00011000 10101010 examples: DA: 11001000 00010111 00010110 10100001 which interface? when looking for forwarding table entry for given destination address, use longest address prefix that matches destination address. longest prefix matching Link interface 0 1 2 3 Problem: address may match two or more table entries: the second DA matches both second and third entries Resolution: use the longest match Problem: address may match two or more table entries: the second DA matches both second and third entries Resolution: use the longest match

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

30 Network Layer4-30 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 Datagram format m IPv4 addressing m ICMP m IPv6 r 4.5 Routing algorithms m Link state m Distance Vector m Hierarchical routing r 4.6 Routing in the Internet m RIP m OSPF m BGP r 4.7 Broadcast and multicast routing

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

32 Cisco 1200 router Network Layer4-32

33 Cisco Network Layer4-33

34 Cisco 2505 router Network Layer4-34

35 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 Layer4-35

36 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 10Gbps input link, 64-byte IP datagram m Input link has 51.2ns 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 Layer4-36

37 Network Layer4-37 Input Port Functions 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 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.

38 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 Physical and link-layer processing m Packet’s version number, checksum and time-to-live fields must be checked and latter two rewritten m Counters used for network management (e.g., number of datagrams received) must be updated. Network Layer4-38

39 Network Layer4-39 Three types of switching fabrics

40 Network Layer4-40 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 Output Port Memory System Bus Single bus/input/output port limits throughput

41 Network Layer4-41 Switching Via a Bus r datagram from input port memory to output port memory via a shared bus (processor not used) m Input port pre-pends an internal header to indicate output port m 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

42 Network Layer4-42 Switching Via An Interconnection Network r overcome bus bandwidth limitations r Banyan networks, other interconnection nets initially developed to connect processors in multiprocessor m All input ports have lines to all output ports m Switching fabric can selectively open connections m 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

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

44 Network Layer4-44 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!

45 Network Layer4-45 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)

46 Network Layer4-46 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!


Download ppt "Network Layer4-1 Chapter 4 Network Layer Part 1: network layer overview datagram networks routers Computer Networking: A Top Down Approach 6 th edition."

Similar presentations


Ads by Google