CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina
2/12/20042 IP Routing Forward datagrams generated either on local host or on some other hosts toward their ultimate destination Static routing: when network is small, single connection point to other networks, no redundant route existent Dynamic routing: use routing daemon to run routing protocol in order to communicate with other routers
2/12/20043 Routing Principles IP performs three steps when searching its routing table 1. Search for a matching host address 2. Search for a matching network address 3. Search for a default entry
2/12/20044 Initialize a Routing Table Three ways to create routing table entries Created by default when an interface is configured Added by route command Created by an ICMP redirect
2/12/20045 route Command Explicitly add or remove routing table entry from configuration files at bootstrap time
2/12/20046 ICMP Redirect Error Sent by a router to sender of an IP datagram when the datagram should have been sent to a different router Used only when the host has a choice of routers to send its datagram to
2/12/20047 ICMP Redirect type(5)code(0-3) checksum router IP address that should be used IP header + first 8 bytes of original datagram data
2/12/20048 ICMP Router Solicitation type(10)code(0) checksum unused (sent as 0)
2/12/20049 ICMP Router Advertisement type(9)code(0) checksum router address [1] preference level [1] router address [2] preference level [2] … number of addresses address entry size(2) lifetime
2/12/ Routing Protocols Executed by routing daemon to communicate routing information with other routers Two types of routing protocols Distance-vector protocols Link-state protocols
2/12/ Distance-vector Protocols Maintain a vector of distances Each router updates its routing table based on vector of distances received from neighbors Example: RIP
2/12/ Link-state Protocols Each router maintains a complete routing table of the network Example: OSPF
2/12/ Routing Information Protocol (RIP) Most widely used routing protocol Carried in UDP datagrams
2/12/ RIP Message Format command(1-6)version(1) (must be 0) bit IP address (must be 0)address family(2) (must be 0) metric(1-16) (up to 24 more routes) 20 bytes
2/12/ RIP Metrics RIP uses hop count as its metric If there are multiple paths, router chooses the one with smallest hop count, and ignores other paths
2/12/ RIP Operation Initialization Request received Response received Regular routing updates Triggered updates
2/12/ Problems with RIP Has no knowledge about subnet addressing Take long time to stabilize after a router or link failure Maximum of metric limits network size No security protection
2/12/ RIP Version 2 Fix some deficiencies of RIP Support multiple domain Include subnet mask Some simple authentication scheme added
2/12/ RIP-2 Message Format command(1-6)version(2) routing domain bit IP address route tagaddress family(2) 32-bit subnet mask 32-bit next-hop IP address metric(1-16) (up to 24 more routes) 20 bytes
2/12/ Next Class Routing protocols: OSPF, BGP UDP Read TI Ch. 10, 11