Computer Networks LECTURE 10 ICMP, SNMP, Inside a Router, Link Layer Protocols Sandhya Dwarkadas Department of Computer Science University of Rochester Assignments Lab 3: IP DUE Friday, October 7 th Assignment 2: Distance Vector Routing DUE Friday, October 14th ICMP: internet control message protocol INTERNET CONTROL MESSAGE PROTOCOL used by hosts & routers to communicate networklevel information error reporting: unreachable host, network, port, protocol echo request/reply (used by ping) network-layer above IP: ICMP msgs carried in IP datagrams ICMP message: type, code plus first 8 bytes of IP datagram causing error Type Code description 0 0 echo reply (ping) 3 0 dest. network unreachable 3 1 dest host unreachable 3 2 dest protocol unreachable 3 3 dest port unreachable 3 6 dest network unknown 3 7 dest host unknown 4 0 source quench (congestion control - not used) 8 0 echo request (ping) 9 0 route advertisement 10 0 router discovery 11 0 TTL expired 12 0 bad IP header Network Layer: Control Plane 5-4 1
Traceroute and ICMP source sends series of UDP segments to destination first set has TTL =1 second set has TTL=2, etc. unlikely port number when datagram in nth set arrives to nth router: router discards datagram and sends source ICMP message (type 11, code 0) ICMP message include name of router & IP address when ICMP message arrives, source records RTTs stopping criteria: UDP segment eventually arrives at destination host destination returns ICMP port unreachable message (type 3, code 3) source stops NETWORK MANAGEMENT 3 probes 3 probes 3 probes Network Layer: Control Plane 5-5 What is network management? Infrastructure for network management autonomous systems (aka network ): 1000s of interacting hardware/software components other complex systems requiring monitoring, control: jet airplane nuclear power plant others? "Network management includes the deployment, integration and coordination of the hardware, software, and human elements to monitor, test, poll, configure, analyze, evaluate, and control the network and element resources to meet the real-time, operational performance, and Quality of Service requirements at a reasonable cost." definitions: managing entity managing entity network management protocol data s contain managed objects whose data is gathered into a Management Information Base (MIB) Network Layer: Control Plane 5-7 Network Layer: Control Plane 5-8 2
SNMP protocol Two ways to convey MIB info, commands: managing entity managing entity SNMP protocol: message types Message type GetRequest GetNextRequest GetBulkRequest Function manager-to-agent: get me data (data instance, next data in list, block of data) request response trap msg InformRequest SetRequest manager-to-manager: here s MIB value manager-to-agent: set MIB value request/response mode trap mode Response Trap Agent-to-manager: value, response to Request Agent-to-manager: inform manager of exceptional event Network Layer: Control Plane 5-9 Network Layer: Control Plane 5-10 SNMP protocol: message formats Get/set header Variables to get/set PDU type (0-3) Request ID Error Status (0-5) Error Index Name Value Name Value. PDU type 4 Enterprise Agent Addr Trap Type (0-7) Specific code Time stamp Name Value. Trap header SNMP PDU Trap info WHAT S INSIDE A ROUTER? More on network management: see earlier editions of text! Network Layer: Control Plane 5-11 3
Router architecture overview high-level view of generic router architecture: router input ports routing processor high-seed ing router output ports routing, management control plane (software) operates in millisecond time frame forwarding data plane (hardware) operates in nanosecond timeframe Network Layer: Data Plane 4-13 Input port functions physical layer: bit-level reception data layer: e.g., Ethernet see chapter 5 line termination layer protocol (receive) lookup, forwarding queueing decentralized ing: using header field values, 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 Network Layer: Data Plane 4-14 Input port functions physical layer: bit-level reception data layer: e.g., Ethernet see chapter 5 line termination layer protocol (receive) lookup, forwarding queueing decentralized ing: using header field values, lookup output port using forwarding table in input port memory ( match plus action ) destination-based forwarding: forward based only on destination IP address (traditional) generalized forwarding: forward based on any set of header field values Network Layer: Data Plane 4-15 Destination-based forwarding 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 forwarding table Link Interface Q: but what happens if ranges don t divide up so nicely? 0 1 2 3 Network Layer: Data Plane 4-16 4
Longest prefix matching longest prefix matching when looking for forwarding table entry for given destination address, use longest address prefix that matches destination address. Destination Address Range 11001000 00010111 00010*** ********* 11001000 00010111 00011000 ********* 11001000 00010111 00011*** ********* otherwise Link interface 0 1 2 3 Longest prefix matching Why longest prefix matching? Longest prefix matching: often performed using ternary content addressable memories (TCAMs) content addressable: present address to TCAM: retrieve address in one clock cycle, regardless of table size Cisco Catalyst: can up ~1M routing table entries in TCAM examples: DA: 11001000 00010111 00010110 10100001 DA: 11001000 00010111 00011000 10101010 which interface? which interface? Network Layer: Data Plane 4-17 Network Layer: Data Plane 4-18 Switching s transfer packet from input buffer to appropriate output buffer ing rate: rate at which packets can be transfer from inputs to outputs often measured as multiple of input/output line rate N inputs: ing rate N times line rate desirable three types of ing s Switching via memory first generation routers: traditional computers with ing under direct control of CPU packet copied to system s memory speed limited by memory bandwidth (2 bus crossings per datagram) memory input port (e.g., Ethernet) memory output port (e.g., Ethernet) memory bus crossbar system bus Network Layer: Data Plane 4-19 Network Layer: Data Plane 4-20 5
Switching via a bus Switching via interconnection network datagram from input port memory to output port memory via a shared bus bus contention: ing speed limited by bus bandwidth 32 Gbps bus, Cisco 5600: sufficient speed for access and enterprise routers bus overcome bus bandwidth limitations banyan networks, crossbar, other interconnection nets initially developed to connect processors in multiprocessor advanced design: fragmenting datagram into fixed length cells, cells through the. Cisco 12000: es 60 Gbps through the interconnection network crossbar Network Layer: Data Plane 4-21 Network Layer: Data Plane 4-22 Input port queuing 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 ports datagram buffer queueing This slide in HUGELY important! layer protocol (send) line termination output port contention: only one red datagram can be transferred. lower red packet is blocked one packet time later: green packet experiences HOL blocking Network Layer: Data Plane 4-23 buffering required when datagrams arrive from faster than the transmission rate scheduling discipline chooses among queued datagrams for transmission performance, network neutrality Datagram (packets) can be lost due to congestion, lack of buffers Priority scheduling who gets best Network Layer: Data Plane 4-24 6
Output port queueing at t, packets more from input to output one packet time later buffering when arrival rate via exceeds output line speed queueing (delay) and loss due to output port buffer overflow! How much buffering? RFC 3439 rule of thumb: average buffering equal to typical RTT (say 250 msec) times capacity C e.g., C = 10 Gpbs : 2.5 Gbit buffer recent recommendation: with N flows, buffering equal to RTT. C N Network Layer: Data Plane 4-25 Network Layer: Data Plane 4-26 Scheduling mechanisms Scheduling policies: priority scheduling: choose next packet to send on FIFO (first in first out) scheduling: send in order of arrival to queue real-world example? discard policy: if packet arrives to full queue: who to discard? tail drop: drop arriving packet priority: drop/remove on priority basis random: drop/remove randomly packet arrivals queue (waiting area) (server) packet departures priority scheduling: send highest priority queued packet multiple classes, with different priorities class may depend on marking or other header info, e.g. IP source/dest, port numbers, etc. real world example? arrivals classify 2 1 3 arrivals packet in service departures high priority queue (waiting area) low priority queue (waiting area) (server) 5 1 3 2 4 5 1 4 3 2 4 departures 5 Network Layer: Data Plane 4-27 Network Layer: Data Plane 4-28 7
Scheduling policies: still more Round Robin (RR) scheduling: multiple classes cyclically scan class queues, sending one complete packet from each class (if available) real world example? 2 1 3 arrivals 4 5 Scheduling policies: still more Weighted Fair Queuing (WFQ): generalized Round Robin each class gets weighted amount of service in each cycle real-world example? packet in service 1 3 2 4 5 departures 1 3 3 4 5 Network Layer: Data Plane 4-29 Network Layer: Data Plane 4-30 Link layer services LINK LAYER AND LANS framing, access: encapsulate datagram into frame, adding header, trailer channel access if shared medium MAC addresses used in frame headers to identify source, destination different from IP address! reliable delivery between adjacent nodes we learned how to do this already (chapter 3)! seldom used on low bit-error (fiber, some twisted pair) wireless s: high error rates Q: why both -level and end-end reliability? Link Layer and LANs 6-32 8
Link layer services (more) flow control: pacing between adjacent sending and receiving nodes error detection: errors caused by signal attenuation, noise. receiver detects presence of errors: signals sender for retransmission or drops frame error correction: receiver identifies and corrects bit error(s) without resorting to retransmission half-duplex and full-duplex with half duplex, nodes at both ends of can transmit, but not at same time Where is the layer implemented? in each and every host layer implemented in adaptor (aka network interface card NIC) or on a chip Ethernet card, 802.11 card; Ethernet chipset implements, physical layer attaches into host s system buses combination of hardware, software, firmware application transport network physical cpu controller physical transmission memory host bus (e.g., PCI) network adapter card Link Layer and LANs 6-33 Link Layer and LANs 6-34 Adaptors communicating Link layer, LANs: outline datagram controller sending host frame sending side: encapsulates datagram in frame adds error checking bits, rdt, flow control, etc. datagram datagram controller receiving host receiving side looks for errors, rdt, flow control, etc. extracts datagram, passes to upper layer at receiving side 6.1 introduction, services 6.2 error detection, correction 6.3 multiple access protocols 6.4 LANs addressing, ARP Ethernet es VLANS 6.5 virtualization: MPLS 6.6 data center networking 6.7 a day in the life of a web request Link Layer and LANs 6-35 Link Layer and LANs 6-36 9
Error detection Parity checking EDC= Error Detection and Correction bits (redundancy) D = Data protected by error checking, may include header fields Error detection not 100% reliable! protocol may miss some errors, but rarely larger EDC field yields better detection and correction single bit parity: detect single bit errors two-dimensional bit parity: detect and correct single bit errors otherwise 0 0 Link Layer and LANs 6-37 * Check out the online interactive exercises for more examples: http://gaia.cs.umass.edu/kurose_ross/interactive/ Link Layer and LANs 6-38 Internet checksum goal: detect errors (e.g., flipped bits) in transmitted packet (note: used at transport layer only) sender: treat segment contents as sequence of 16-bit integers checksum: 1 s complement of addition (1 s complement sum) of segment contents sender puts checksum value into UDP checksum field receiver: compute checksum of received segment check if computed checksum equals checksum field value: NO - error detected YES - no error detected. But maybe errors nonetheless? Internet checksum: example example: add two 16-bit integers wraparound sum checksum 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 Note: when adding numbers, a carryout from the most significant bit needs to be added to the result * Check out the online interactive exercises for more Link Layer and LANs 6-39 examples: http://gaia.cs.umass.edu/kurose_ross/interactive/ Transport Layer 3-40 10
Cyclic redundancy check more powerful error-detection coding view data bits, D, as a binary number choose r+1 bit pattern (generator), G goal: choose r CRC bits, R, such that <D,R> exactly divisible by G (modulo 2) receiver knows G, divides <D,R> by G. If non-zero remainder: error detected! can detect all burst errors less than r+1 bits widely used in practice (Ethernet, 802.11 WiFi, ATM) CRC example want: D. 2 r XOR R = ng equivalently: D. 2 r = ng XOR R equivalently: if we divide D. 2 r by G, want remainder R to satisfy: D R. 2 r = remainder[ ] G Link Layer and LANs 6-41 * Check out the online interactive exercises for more examples: http://gaia.cs.umass.edu/kurose_ross/interactive/ Link Layer and LANs 6-42 Disclaimer Parts of the lecture slides are adapted from and copyrighted by James Kurose and Keith Ross and from those by Prof. Kai Shen. The slides are intended for the sole purpose of instruction of computer networks at the University of Rochester. All copyrighted materials belong to their original owner(s). 11