The Internet is based on the AS concept, therefore, two types of routing protocols are required:
Interior Gateway Protocol (IGP) : A routing protocol that was designed and intended for use inside a single autonomous system (AS) Known Interior Gateway Protocols (IGP) are Routing Information Protocol (RIP), Interior Gateway Routing Protocol (IGRP), Open Shortest Path First (OSPF) and Intermediate System to Intermediate System (IS-IS)
Exterior Gateway Protocol (EGP): A routing protocol that was designed and intended for use between different autonomous systems Exterior Gateway Protocol (EGP) is commonly used in the Internet to exchange routing table information. There is only one Exterior Gateway Protocol (EGP) exists and it is Border Gateway Protocol (BGP).
3.5.a Distance vector:
In distance vector routing: a router need not know the entire path to every network segment, it only requires to know the direction or vector in which to send the packet. The technique determines the direction (vector) and distance (hop count) to any network in the internetwork. Distance vector routing algorithms periodically send all or parts of their routing table to their adjacent neighbors. The routers running a distance vector routing protocol will automatically send periodic updates even if there are no changes in the network. It uses Bellman Ford algorithm for calculating the shortest cost path.
RIP and EIGRP is a commonly used distance vector protocol that uses hop counts or its routing metrics.
3.5.b Link state:
In link-state routing: each router attempt to construct its own internal map of the network topology. At the initial stage of start-up, when a router becomes active, it sends the messages into the network and collects the information from the routers to which it is directly connected. It also provides the information about whether the link to reach the router is active or not. This information is used by other routers to build a map of network topology. Then the router uses the map to choose the best path. . It uses dijkstras algorithm for calculating the shortest path.OSPF, BGP and EGP are the examples for link state.
3.5.c Path Vector:
A path vector protocol is a network routing protocol which maintains the path information that gets updated dynamically. Each entry in the routing table contains the destination network, the next router and the path to reach the destination. Border Gateway Protocol (BGP) is an example of a path vector protocol. A path vector protocol does not rely on the cost of reaching a given destination to determine whether each path available is loop free or not. Instead, path vector protocols rely on analysis of the path to reach the destination to learn if it is loop free or not.