* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Routing - King Fahd University of Petroleum and Minerals
Point-to-Point Protocol over Ethernet wikipedia , lookup
Asynchronous Transfer Mode wikipedia , lookup
Backpressure routing wikipedia , lookup
IEEE 802.1aq wikipedia , lookup
Distributed firewall wikipedia , lookup
Deep packet inspection wikipedia , lookup
Piggybacking (Internet access) wikipedia , lookup
List of wireless community networks by region wikipedia , lookup
Internet protocol suite wikipedia , lookup
Zero-configuration networking wikipedia , lookup
Network tap wikipedia , lookup
Computer network wikipedia , lookup
Airborne Networking wikipedia , lookup
Multiprotocol Label Switching wikipedia , lookup
Recursive InterNetwork Architecture (RINA) wikipedia , lookup
Wake-on-LAN wikipedia , lookup
Cracking of wireless networks wikipedia , lookup
Short Course on TCP/IP IP Routing Dr. Nasir Darwish [email protected] Information and Computer Science Department King Fahd University of Petroleum and Minerals Dhahran, Saudi Arabia IP Network Addressing IP is Internetwork Protocol. Each Host (and Router) network interface uses a 32-bit IP-address, part of which is a network address. The network part of the address is same for all hosts on the same physical network (e.g. LAN). 32 bits 8, 16, or 24 bits from InterNIC (or locally chosen) Varies with subnet mask Network ID Host ID Router Physical LAN IP Address Classes Class A B C Net Part 8 16 24 Host Part 24 16 8 First Byte Value Subnet Mask 1 - 127 128 - 191 192 - 223 255.0.0.0 255.255.0.0 255.255.255.0 IP Routing: Next Hop? Which router (hop) to forward the IP packet to next? Router Basic Function The router matches the IP destination address of an incoming packet with an entry in his routing table The router then encapsulates the IP packet in an outgoing frame addressed to the hardware address of next router (or to destination host) A R0 200.1.1.1 200.1.1.1 196.1.1.1 data R0 R1 B R1 Host A A/R0 (R1/B) : From/To Data Link layer addresses Note: IP addresses are unchanged 200.1.1.1 196.1.1.1 196.1.1.1 Host B data Routing Table at a Host 202.10.10.0 201.12.5.0 173.4.0.0 201.12.5.1 202.10.10.3 173.4.0.1 200.1.1.10 200.1.1.11 200.1.1.12 200.1.1.1 other hosts Host A Dest. Network 200.1.1.0 200.12.5.0 202.10.10.0 Subnet Mask 255.255.255.0 255.255.255.0 255.255.255.0 173.4.0.0 255.255.0.0 Next Hop Directly Conn. 200.1.1.10 200.1.1.11 200.1.1.12 Routing Table at a Router 202.10.10.0 201.12.5.0 P2 P1 201.12.5.1 R0 200.1.1.10 173.4.0.0 202.10.10.3 173.4.0.1 200.1.1.11 200.1.1.12 Routing Table for R0 200.1.1.0 Dest. Network Subnet Mask Next Hop 200.1.1.0 201.12.5.0 202.10.10.0 255.255.255.0 255.255.255.0 255.255.255.0 Directly Conn. Directly Conn. 173.4.0.0 255.255.0.0 200.1.1.11 200.1.1.12 Interface P1 P2 P1 P1 Processing Steps for Incoming Packet Incoming packets wait in a queue (memory buffer). That is why a router is a store-and-forward of packets in contrast to a bridge which is a store-andforward of frames. The header is checked for errors by recomputing checksum and matching it with the received checksum. Next, verify that various field values in the IP header are valid. If not OK, drop the packet and send ICMP message to source host. 1. Decrement TTL and drop packet if TTL reaches 0, send ICMP message to source host; otherwise, update the header checksum. 2. The router compares the routing table Dest. Network entry with NetID part of IP-DA (Is IP-DA and Mask = Dest. Network?) until a matching entry is found. Then the router uses the information in the matching row to determine the datalink layer (DL) destination address for the outgoing frame -- i.e., It may use ARP to find the DL address of next router (or destination host) from its IP address. 3. The packet is then encapsulated in an outgoing frame whose DL-DA is that found in step 3; DL-SA is that of the outgoing interface. 4. TCP/IP 5-Layer Model Application Application TCP Transport Transport IP Network Network Network Data Link Data Link Data Link Physical Physical Physical Computer A IP Router Computer B IP-Layer Operation B Y X C A X Y Application Application TCP is end-to-end layer TCP TCP IP IP IP IP IP Data Link Data Link Data Link Data Link Data Link Physical Physical Physical Physical Physical A B C Static versus Dynamic Routes Static Route uses a protocol route that a network administrator enters into the router. Dynamic Route uses a route that a network routing protocol adjusts automatically for topology or traffic changes. Static Route Example Router Only a single network connection with no need for routing updates Point-to-point or circuitswitched connection Router local network Fixed route to address reflects administrator’s knowledge. Default Route Example Company X Router A B Router Internet Router Router Routing Table If no entry for destination net Try Router B (default router) Use if next hop is not explicitly listed in the routing table Adapting to Topology Change Router Router Router Router An alternate route can substitute for a failed route. Dynamic Routing Operations Network Layer Routing Protocol Routing Table Router Routing Protocol A router passes routing information to its neighbors Routing Table Router Dynamic Routing Operations Routing protocol maintains and distributes routing information. The success of dynamic routing depends on two basic router functions: Maintenance of routing table Timely distribution of knowledge -- in the form of routing updates -- to other routers Dynamic routing relies on a routing protocol to disseminate knowledge. Representing Distance with Metrics The metrics most commonly used by routers are: Bandwidth Delay Load Reliability Hop Count Cost Classes of Routing Protocols Most routing algorithms can be classified as conforming to one of two basic algorithms: distance vector and link state. The distance vector routing approach determines the direction (vector) and distance to any link in the internetwork. The link-state approach re-creates the exact topology of the entire internetwork (or at least the partition in which the router is situated). One Issue: Time to Convergence Convergence occurs when all routers use a consistent perspective of network topology After a topology changes, routers must recompute routes, which disrupts routing The process and time required for router reconvergence varies in routing protocols Distance Vector Concept Distance vector based routing algorithm (also known as Bellman-Ford algorithms) passes periodic copies of a routing table from router to router. Regular updates between routers communicate topology changes. Each router receives a routing table from its direct neighbor. For example, in the graphic, router B receives information from router A. Router B adds a distance vector number (such as a number of hops) increasing the distance vector, then passes the routing table to its other neighbor, C. The process continues between directneighbor routers. In this way, the algorithm accumulates network distances so it can maintain a database of internetwork topology information. Distance Vector Network Discovery A B W X Router C Y Router Z Router Routing Table Routing Table Routing Table W 0 X 0 Y 0 X 0 Y 0 Z 0 Y 1 Z 1 X 1 Z 2 W 1 W 2 Distance Vector Network Discovery Each router using distance vector routing begins by identifying its own neighbors. In the graphic, the port to each directly connected network is shown as having a distance of 0. As the distance vector network discovery process proceeds, routers discover the best path to destination networks based on accumulated metrics from each neighbor. Routing Information Protocol (RIP) Included as routed (route-dee) program which is part of Berkley's Unix TCP/IP. RIP was in widespread use years before it was standardized in as RFC 1058 in 1988. Version 2 of RIP was completed in 1994. Uses Hop Count (# of routers to destination) as a distance metric. Each router broadcasts its routing table every 30-sec. Routes are not updated beyond a hop count of 15 RIP messages Use UDP packets with source and destination ports set to 520 RIP Update Mechanism When a router receives a neighbor's table, it examines it entry by entry Adds 1 (or sometimes more if the corresponding link is slow) to the metric If the destination is new, it is added to the local routing table If the destination is known before and the update provides a smaller metric, the existing entry in the local routing table is replaced If for existing non-direct entry no router update info. Is received within three cycles (90 sec), the entry is removed Triggered Updates To speed up the process of discovering change Whenever a router changes its metric for a route, it broadcasts the change. This may lead to more triggered updates by other routers It is best that whenever an update occurs , that the router waits for some short time and send updates in batches If a destination is marked unreachable it includes a hold down rule (time period) during which updates are ignored. This prevents misinformation from spreading. Incorrect Route Info Lead to Loops A B C D 10 hops link broken Network N Info. at A, B, C (before link is broken) : Network N, Metric=2 After link is broken, what if Router D gets a scheduled update from A with the old info. Network: N Next Hop:A Metric: 3 D sends traffic for Network N to A which sends to D which sends to A --- Split Horizon Technique The router records the interface over which a new route is received. The router does not send this update back through the interface on which it is received In the previous example, Router A updates on the shown interface will not include entries for Network N Break