EGP (External Gateway Protocol)

External Gateway Protocol (EGP) is a protocol used in computer networks to exchange routing information between autonomous systems (AS). It is an inter-domain routing protocol that allows different AS to communicate with each other and exchange routing information.
EGP is one of the oldest routing protocols, and it was originally defined in RFC 827 in 1982. The protocol has since been updated and replaced by newer protocols such as Border Gateway Protocol (BGP). However, some legacy systems still use EGP, and it is important to understand the protocol's workings to troubleshoot network issues and to better understand the evolution of routing protocols.
EGP operates on the network layer of the OSI model, specifically in the Internet layer (layer 3). It is used to exchange routing information between AS to determine the best path for forwarding data packets between them. An autonomous system is a collection of routers and networks that are under a single administrative domain.
EGP is a distance-vector protocol, which means that each router sends periodic updates to its neighboring routers, advertising the distance or cost to reach each destination network. The cost is usually measured in terms of hop count or the number of routers that a packet must traverse to reach the destination.
In EGP, the autonomous systems are classified as either transit AS or stub AS. Transit AS are those that allow traffic to pass through them to reach other AS, while stub AS are those that have only one connection to another AS and do not allow traffic to pass through them.
EGP uses a hop-by-hop approach to exchange routing information between neighboring routers. Each router sends an update message to its immediate neighbors, which in turn forward the message to their own neighbors until all routers in the AS have received the update.
The EGP update messages contain information about the autonomous system, the cost to reach each destination network, and the path that the packet should take to reach the destination network. Each update message also includes a sequence number to ensure that the routers receive the messages in the correct order.
When a router receives an update message, it compares the cost of reaching each destination network as advertised by its neighbors and selects the best path based on the lowest cost. The router then updates its routing table with the new information and sends the updated information to its own neighbors.
EGP is designed to prevent loops in the routing table, which can occur when two routers advertise the same network with different costs. To avoid this, EGP employs a technique called path vector. Each router maintains a list of the autonomous systems that a packet must traverse to reach the destination network. If two routers advertise the same network with different paths, the router with the shortest path is selected.
One of the limitations of EGP is that it does not support classless inter-domain routing (CIDR), which is a mechanism for more efficient use of IP address space. CIDR allows networks to be divided into smaller subnets, which can be assigned to different organizations or departments. EGP only supports classful routing, which means that the IP address is divided into three classes: A, B, and C, and the routing decisions are based on the class of the network address.
Another limitation of EGP is that it does not support multiple paths to a destination network. This means that if there are multiple paths to a destination network, EGP can only select one path, which may not be the optimal path.
In conclusion, External Gateway Protocol (EGP) is an inter-domain routing protocol used to exchange routing information between autonomous systems. It is a distance-vector protocol that operates on the network layer of the OSI model. EGP uses a hop-by-hop approach to exchange routing information between neighboring routers and employs path vector to prevent loops in the routing table. EGP has limitations such as not supporting classless inter-domain routing (CIDR) and not supporting multiple paths to a destination network, which have been addressed by newer routing protocols such as BGP.
Despite its limitations, EGP played an important role in the early days of the Internet and paved the way for newer and more advanced routing protocols. It is still used in some legacy systems and is important to understand its workings to troubleshoot network issues and to better understand the evolution of routing protocols.