Download presentation
Presentation is loading. Please wait.
Published bySilvia Owen Modified over 9 years ago
1
Chapter 4 Network Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students, readers). They’re in PowerPoint form so you see the animations; and can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following: If you use these slides (e.g., in a class) that you mention their source (after all, we’d like people to use our book!) If you post any slides on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material. Thanks and enjoy! JFK/KWR All material copyright 1996-2012 J.F Kurose and K.W. Ross, All Rights Reserved Network Layer 4-1
2
Network Layer 4-2 Chapter 4: network layer chapter goals: understand principles behind network layer services: network layer service models forwarding versus routing how a router works routing (path selection) broadcast, multicast instantiation, implementation in the Internet
3
Network Layer 4-3 4.1 introduction 4.2 virtual circuit and datagram networks 4.3 what’s inside a router 4.4 IP: Internet Protocol datagram format IPv4 addressing ICMP IPv6 4.5 routing algorithms link state distance vector hierarchical routing 4.6 routing in the Internet RIP OSPF BGP 4.7 broadcast and multicast routing Chapter 4: outline
4
Network Layer 4-4 Network layer transport segment from sending to receiving host on sending side encapsulates segments into datagrams on receiving side, delivers segments to transport layer network layer protocols in every host, router 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 Layer 4-5 Two key network-layer functions forwarding: move packets from router’s input to appropriate router output routing: determine route taken by packets from source to dest. routing algorithms analogy: routing: process of planning trip from source to dest forwarding: process of getting through single interchange
6
Network Layer 4-6 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 routing algorithm determines end-end-path through network forwarding table determines local forwarding at this router
7
The routing algorithm may be centralized with an algorithm executing on a central site and downloading routing information to each of the routers) or may be decentralized with a piece of the distributed routing algorithm running in each router In either case, a router receives routing protocol messages, which are used to configure its forwarding table. Network Layer 4-7 Interplay between routing and forwarding
8
Network Layer 4-8 Connection setup 3 rd important function in some network architectures: ATM, frame relay, X.25 before datagrams flow, two end hosts and intervening routers establish virtual connection routers get involved network vs transport layer connection service: network: between two hosts (may also involve intervening routers in case of VCs) transport: between two processes
9
Network Layer 4-9 Network service model Q: What service model for “channel” transporting datagrams from sender to receiver? example services for individual datagrams: guaranteed delivery guaranteed delivery with with bounded delay less than 40 msec delay example services for a flow of datagrams: in-order datagram delivery guaranteed minimum bandwidth to flow restrictions on changes in inter-packet spacing security services
10
Network Layer 4-10 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 ?
11
ATM Network Services Constant bit rate (CBR) ATM network service the first ATM service model to be standardized, service for carrying real-time, constant bit rate audio and video traffic. Goal: to provide a flow of packets with a virtual pipe whose properties are the same as if a dedicated fixed-bandwidth transmission link existed between sending and receiving hosts Available bit rate (ABR) ATM network service a minimum cell transmission rate is guaranteed to a connection using ABR service Variable Bit Rate (VBR) ATM network service transport traffic at variable rates Unspecified Bit Rate (UBR) ATM network service used for applications that are very tolerant of delay and cell loss Network Layer 4-11
12
Network Layer 4-12 4.1 introduction 4.2 virtual circuit and datagram networks 4.3 what’s inside a router 4.4 IP: Internet Protocol datagram format IPv4 addressing ICMP IPv6 4.5 routing algorithms link state distance vector hierarchical routing 4.6 routing in the Internet RIP OSPF BGP 4.7 broadcast and multicast routing Chapter 4: outline
13
Network Layer 4-13 Connection, connection-less service datagram network provides network-layer connectionless service virtual-circuit network provides network-layer connection service analogous to TCP/UDP connecton-oriented / connectionless transport-layer services, but: service: host-to-host no choice: network provides one or the other implementation: in network core
14
Network Layer 4-14 Virtual circuits call setup, teardown for each call before data can flow each packet carries VC identifier (not destination host address) every router on source-dest path maintains “state” for each passing connection link, router resources (bandwidth, buffers) may be allocated to VC (dedicated resources = predictable service) “source-to-dest path behaves much like telephone circuit” performance-wise network actions along source-to-dest path
15
Network Layer 4-15 VC implementation a VC consists of: 1.path from source to destination 2.VC numbers, one number for each link along path 3.entries in forwarding tables in routers along path packet belonging to VC carries VC number (rather than dest address) VC number can be changed on each link. new VC number comes from forwarding table If a common VC number were required for all links along the path, the routers would have to exchange and process a substantial number of messages to agree on a common VC number
16
Network Layer 4-16 VC 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: VC routers maintain connection state information!
17
Network Layer 4-17 application transport network data link physical Virtual circuits: signaling protocols used to setup, maintain, teardown VC The messages that the end systems send into the network to initiate or terminate a VC, and the messages passed between the routers to set up the VC are known as signaling messages used in ATM, frame-relay, X.25 not used in today’s Internet 1. initiate call 2. incoming call 3. accept call 4. call connected 5. data flow begins 6. receive data application transport network data link physical
18
Network Layer 4-18 Datagram networks 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 1. send datagrams application transport network data link physical application transport network data link physical 2. receive datagrams
19
Network Layer 4-19 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, so rather than list individual destination address list range of addresses (aggregate table entries)
20
Network Layer 4-20 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
21
Network Layer 4-21 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
22
Maintaining Forwarding Tables Routers in datagram networks maintain no connection state information, but: they maintain forwarding state information in their forwarding tables. The time scale at which this forwarding state information changes is relatively slow. forwarding tables are modified by the routing algorithms, which typically update a forwarding table every one-to-five minutes Network Layer 4-22
23
Network Layer 4-23 Datagram or VC network: why? Internet (datagram) data exchange among computers “elastic” service, no strict timing req. many link types different characteristics uniform service difficult “smart” end systems (computers) can adapt, perform control, error recovery A new service can be deployed in a remarkably short period of time simple inside network, complexity at “edge” ATM (VC) evolved from telephony human conversation: strict timing, reliability requirements need for guaranteed service “dumb” end systems telephones complexity inside network
24
Network Layer 4-24 4.1 introduction 4.2 virtual circuit and datagram networks 4.3 what’s inside a router 4.4 IP: Internet Protocol datagram format IPv4 addressing ICMP IPv6 4.5 routing algorithms link state distance vector hierarchical routing 4.6 routing in the Internet RIP OSPF BGP 4.7 broadcast and multicast routing Chapter 4: outline
25
Network Layer 4-25 Router architecture overview two key router functions: run routing algorithms/protocol (RIP, OSPF, BGP) forwarding datagrams from incoming to outgoing link high-seed switching fabric routing processor router input ports router output ports forwarding data plane (hardware) routing, management control plane (software) forwarding tables computed, pushed to input ports executes routing algorithms
26
Router architecture overview router’s input ports, output ports, and switching fabric together implement the forwarding function and are almost always implemented in hardware referred to as the router forwarding plane forwarding plane operates at the nanosecond time scale a router’s control functions: executing the routing protocols, responding to attached links that go up or down, and performing management functions These router control plane functions are usually implemented in software operate at the millisecond or second timescale Network Layer 4-26
27
Network Layer 4-27 line termination link layer protocol (receive) lookup, forwarding queueing Input port functions decentralized switching: given datagram dest., lookup output port using forwarding table in input port memory (“match plus action”) 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 see chapter 5 switch fabric
28
Input port functions The lookup performed in the input port is central to the router’s operation it is here that the router uses the forwarding table to look up the output port port here— referring to the physical input and output router interfaces The forwarding table is copied from the routing processor to the input line cards over a separate bus Besides lookup, many other actions must be taken: (1) physical- and link-layer processing must occur (2) the packet’s version number, checksum and time-to-live field (3) counters used for network management (such as the number of IP datagrams received) must be updated Network Layer 4-28
29
Network Layer 4-29 Switching fabrics transfer packet from input buffer to appropriate output buffer switching rate: rate at which packets can be transfer from inputs to outputs often measured as multiple of input/output line rate N inputs: switching rate N times line rate desirable three types of switching fabrics memory bus crossbar
30
Network Layer 4-30 Switching via memory first generation routers: traditional computers with switching under direct control of CPU packet copied to system’s memory speed limited by memory bandwidth if the memory bandwidth is such that B packets per second can be written into, or read from, memory, then the overall forwarding throughput must be less than B/2 input port (e.g., Ethernet) memory output port (e.g., Ethernet) system bus
31
Network Layer 4-31 Switching via a bus datagram from input port memory to output port memory via a shared bus If multiple packets arrive to the router at the same time, each at a different input port, all but one must wait since only one packet can cross the bus at a time bus contention: switching speed limited by bus bandwidth 32 Gbps bus, Cisco 5600: sufficient speed for access and enterprise routers bus
32
Network Layer 4-32 Switching via interconnection network overcome bus bandwidth limitations interconnection networks initially developed to connect processors in multiprocessor A crossbar switch is an interconnection network consisting of 2N buses that connect N input ports to N output ports A-to-Y and B-to-X packets can be forwarded at the same time Cisco 12000: switches 60 Gbps through the interconnection network allow packets from different input ports to proceed towards the same output port at the same time crossbar
33
Network Layer 4-33 Output ports takes packets that have been stored in the output port’s memory and transmits them over the output link buffering required when datagrams arrive from fabric faster than the transmission rate scheduling discipline chooses among queued datagrams for transmission line termination link layer protocol (send) switch fabric datagram buffer queueing
34
Network Layer 4-34 Output port queueing buffering when arrival rate via switch exceeds output line speed queueing (delay) and loss due to output port buffer overflow! at t, packets more from input to output one packet time later switch fabric switch fabric
35
Network Layer 4-35 How much buffering? RFC 3439 rule of thumb: average buffering equal to “typical” RTT (say 250 msec) times link capacity C e.g., C = 10 Gpbs link: 2.5 Gbit buffer recent recommendation: with N flows, buffering equal to if there is not enough memory to buffer an incoming packet, a decision must be made to either drop the arriving packet (a policy known as drop-tail) or remove one or more already-queued packets to make room for the newly arrived packet In some cases, it may be advantageous to drop a packet before the buffer is full in order to provide a congestion signal to the sender RTT C. N
36
Network Layer 4-36 Input port queuing fabric slower than input ports combined -> queueing may occur at input queues queueing delay and loss due to input buffer overflow! Head-of-the-Line (HOL) blocking: queued datagram at front of queue prevents others in queue from moving forward output port contention: only one red datagram can be transferred. lower red packet is blocked switch fabric one packet time later: green packet experiences HOL blocking switch fabric
37
Network Layer 4-37 4.1 introduction 4.2 virtual circuit and datagram networks 4.3 what’s inside a router 4.4 IP: Internet Protocol datagram format IPv4 addressing ICMP IPv6 4.5 routing algorithms link state distance vector hierarchical routing 4.6 routing in the Internet RIP OSPF BGP 4.7 broadcast and multicast routing Chapter 4: outline
38
Network Layer 4-38 The Internet network layer forwarding table host, router network layer functions: routing protocols path selection RIP, OSPF, BGP IP protocol addressing conventions datagram format packet handling conventions ICMP protocol error reporting router “signaling” transport layer: TCP, UDP link layer physical layer network layer
39
Network Layer 4-39 ver length 32 bits data (variable length, typically a TCP or UDP segment) 16-bit identifier header checksum time to live 32 bit source IP address head. len type of service flgs fragment offset upper layer 32 bit destination IP address options (if any) IP datagram format IP protocol version number header length (bytes) upper layer protocol to deliver payload to total datagram length (bytes) “type” of data for fragmentation/ reassembly max number remaining hops (decremented at each router) e.g. timestamp, record route taken, specify list of routers to visit. how much overhead? 20 bytes of TCP 20 bytes of IP = 40 bytes + app layer overhead used only when an IP datagram reaches its final destination
40
Network Layer 4-40 IP fragmentation, reassembly network links have MTU (max.transfer size) - largest possible link-level frame different link types, different MTUs large IP datagram divided (“fragmented”) within net one datagram becomes several datagrams “reassembled” only at final destination IP header bits used to identify, order related fragments fragmentation: in: one large datagram out: 3 smaller datagrams reassembly … …
41
Network Layer 4-41 ID =x offset =0 fragflag =0 length =4000 ID =x offset =0 fragflag =1 length =1500 ID =x offset =185 fragflag =1 length =1500 ID =x offset =370 fragflag =0 length =1040 one large datagram becomes several smaller datagrams example: 4000 byte datagram MTU = 1500 bytes 1480 bytes in data field offset = 1480/8 IP fragmentation, reassembly
42
Network Layer 4-42 4.1 introduction 4.2 virtual circuit and datagram networks 4.3 what’s inside a router 4.4 IP: Internet Protocol datagram format IPv4 addressing ICMP IPv6 4.5 routing algorithms link state distance vector hierarchical routing 4.6 routing in the Internet RIP OSPF BGP 4.7 broadcast and multicast routing Chapter 4: outline
43
Network Layer 4-43 IP addressing: introduction IP address: 32-bit identifier for host, router interface interface: connection between host/router and physical link router’s typically have multiple interfaces host typically has one or two interfaces (e.g., wired Ethernet, wireless 802.11) IP addresses associated with each interface 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.2 223.1.3.1 223.1.3.27 223.1.1.1 = 11011111 00000001 00000001 00000001 223 111
44
Network Layer 4-44 IP addressing: introduction Q: how are interfaces actually connected? A: we’ll learn about that in chapter 5, 6. 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.2 223.1.3.1 223.1.3.27 A: wired Ethernet interfaces connected by Ethernet switches A: wireless WiFi interfaces connected by WiFi base station For now: don’t need to worry about how one interface is connected to another (with no intervening router)
45
Network Layer 4-45 Subnets IP address: subnet part - high order bits host part - low order bits what’s a subnet ? device interfaces with same subnet part of IP address can physically reach each other without intervening router network consisting of 3 subnets 223.1.1.1 223.1.1.3 223.1.1.4 223.1.2.9 223.1.3.2 223.1.3.1 subnet 223.1.1.2 223.1.3.27 223.1.2.2 223.1.2.1
46
Network Layer 4-46 recipe to determine the subnets, detach each interface from its host or router, creating islands of isolated networks each isolated network is called a subnet subnet mask: /24 Subnets 223.1.1.0/24 223.1.2.0/24 223.1.3.0/24 223.1.1.1 223.1.1.3 223.1.1.4 223.1.2.9 223.1.3.2 223.1.3.1 subnet 223.1.1.2 223.1.3.27 223.1.2.2 223.1.2.1
47
Network Layer 4-47 how many? 223.1.1.1 223.1.1.3 223.1.1.4 223.1.2.2 223.1.2.1 223.1.2.6 223.1.3.2 223.1.3.1 223.1.3.27 223.1.1.2 223.1.7.0 223.1.7.1 223.1.8.0223.1.8.1 223.1.9.1 223.1.9.2 Subnets
48
Network Layer 4-48 IP addressing: CIDR CIDR: Classless InterDomain Routing subnet portion of address of arbitrary length address format: a.b.c.d/x, where x is # bits in subnet portion of address 11001000 00010111 00010000 00000000 subnet part host part 200.23.16.0/23
49
IP addressing: CIDR The x most significant bits of an address of the form a.b.c.d/x constitute the network portion of the IP address, and are often referred to as the prefix (or network prefix) of the address. An organization is typically assigned a block of contiguous addresses, that is, a range of addresses with a common prefix when a router outside the organization forwards a datagram whose destination address is inside the organization, only the leading x bits of the address need be considered. This considerably reduces the size of the forwarding table in these routers Network Layer 4-49
50
IP addressing: CIDR Another type of IP address, the IP broadcast address 255.255.255.255 When a host sends a datagram with destination address 255.255.255.255, the message is delivered to all hosts on the same subnet Network Layer 4-50
51
Next week Having now studied IP addressing in detail Next week how hosts and subnets get their addresses in the first place Network Layer 4-51
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.