One of the top priority of the network layer is to route the data traffic in a particular direction. This is done keeping in mind the optimum use of resources and the shortest path as decided by the internet routing protocols to be more specific.
Before we dig deep inside the topic of routing, we must first define and understand the various types of routing protocols present at first i.e unicast , multicast and broadcast routing protocols.Let us clarify these terms as they relate to the Internet.
What we mean by Unicasting in internet ?
In unicast communication, there is only one source and one destination. The relationship between the source and the destination is kind of one-to-one. In this type of communication both the source and the destination addresses, in the IP datagram, are the unicast addresses assigned to the hosts (or host interfaces, to be more exact).
In unicast , packet starts from source S1 and passes through routers to reach the destination D1 (refer below figure).
Note : In unicasting, the router forwards the received packet through only one of its interfaces .
What we mean by multicasting in internet ?
In multicast communication, there is only one source and a group of destinations. The relationship is kind of one-to-many. In this type of communication, the source address is a unicast address but the destination address is a group address, which will define one or more destinations.
The group address mainly identifies the members of the group. A multicast packet starts from the source S1 and goes to all destinations that belong to group G1(refer below figure).
Note : In multicasting , router may forward the received packets through several of its interfaces.
What is broadcasting in internet ?
In broadcast communication, the relationship between the source and the destination will be one-to-all. There is only one source, but all the other hosts are the destinations.
The Internet doesn’t explicitly support broadcasting because of the huge amount of traffic it could create and because of the bandwidth, it would need.
Now let us concentrate on the main topic of this post i.e. Unicast Protocols in the network layer. (multicasting and broadcasting protocols covered in the subsequent posts)
Unicast Routing Protocols in internet
Today, the internet can be so large that only one routing protocol cannot able to handle the task of updating the routing tables of all routers. For this reason, the internet is mainly divided into autonomous systems.
An autonomous system (AS) is a group of networks and routers under the authority of a single administration. Routing inside any autonomous system is referred to as intradomain (or interior routing) routing. Routing between autonomous systems is referred to as interdomain (or exterior routing )routing.
The well known interior protocols are RIP (Routing information protocol) and OSPF (Open Shortest Path First). Whereas the popular exterior protocol used popularly is BGP (Border Gateway Protocol).
RIP and OSPF are used to upgrade the routing tables inside an AS(an autonomous system ‘AS’ is a group of networks and routers under the authority of a single administration.
Routing inside any autonomous system is referred to as intradomain routing. Routing between autonomous systems is referred to as interdomain routing) and BGP is used for upgrading the routing tables for the routers which join multiple AS together.
Routing Information Protocol
Routing Information Protocol (RIP) is an implementation of the distance vector protocol.In distance vector routing, the least-cost route between any two nodes is the route with minimum distance.
RIP is used for updating the routing tables. The routing updates are exchanged between the neighboring routers every 30 seconds with the help of the RIP response message.
These messages are also known as RIP advertisements. These messages are sent by the routers or hosts. They contain a list of multiple destinations within an autonomous system (AS). RIP is an interior routing protocol used inside an autonomous system (AS). Its operation is based on distance vector routing.
Note : We can think of nodes as the cities in an area and the lines as the roads connecting them. A table can show a tourist the minimum distance between cities.
Routing table in RIP
A typical routing table mainly consists of the following fields:
- Hop Count
- Next Router
- Other Information
Every router is supposed to keep such a table within it. The destination column consists of the destination network address. The hop count column basically consists of the shortest distance to reach the destination and the next router column then consists of the address of the next router to which the packet is to be forwarded.
How to Initialize the Routing Table
Each node knows how to reach any other node. When a new router is added to a network it initializes its routing table. Such a table consists of the information only about the directly attached networks and the corresponding hop counts. The next-hop field i.e which identifies the next router is empty.
RIP work is a combination of a routing database that stores information on the fastest route from computer to computer.
An update process that enables each router to tell other routers which route is the fastest from its point of view and an update algorithm that enables each router in order to update its database with the fastest route communicated from the neighboring routers.
Each router on the Internet keeps a database that stores the following information for every computer in the same RIP network :
- IP Address: The Internet Protocol address of the host computer.
- Gateway: The best gateway to send a message addressed to that required IP address.
- Distance : It represents the number of routers between this router and the router that can send the message directly to that IP address.
- Route change flag : It is a flag that indicates that this information has changed used by other routers to update their own databases.
- Timers: It mainly represents various timers.
RIP uses the UDP network protocol because of its efficiency and there are no problems if a message gets lost due to any reason. This is because the next update will be coming in a short time.
At regular intervals, each router sends an update message which has full information about its routing database to all the other routers that are directly connected to it.
Note : In distance vector routing, each node shares its routing table with its immediate neighbors periodically and when there is a change.
RIP Message Format
RIP messages can be broadly classified into two types : messages that deliver routing information and messages that request routing information.
Command : Indicates whether the type of the packet i.e. a request or a response. The request asks that the router send all or part of its routing table. The response can be any unsolicited regular routing update or a reply to a request.
Version number : This field specifies the RIP version used. This field can signal different potentially incompatible versions.
Zero : This field is not actually used by RFC 1058 RIP, it was added just to provide backward compatibility with the older versions of RIP. Its default value is zero.
Address-family identifier (AFI) : This field is used to specify the address family used. RIP is designed to carry the routing information for several different protocols.
Address : This field is used to specify the IP address for the entry.
Metric : This field indicates the number of hops (routers) has been traversed in the trip to the destination. This value is between the numeric 1 and 15 for a valid route or 16 for an unreachable route.
Demerits of RIP
- RIP only understands the shortest route to a destination based on a simple count of the number of router hops.
- Distances are based on hops, not on real costs (such as the speed of link).
RIP Version 2
In November 1994, RIP was modified with some additions (extensions) to overcome some of its shortcomings. RIP version 1 is still being used on many routers and continues to outnumber OSPF networks.
The modified RIP is called RIP version 2 protocol.Version 2 is backward compatible with version 1 and contains all of the capabilities of the version 1 protocol.RIP version 2 implemented the following features:
- Authentication by means of a simple text password.
- Multicasting used to allow for variable-length subnet masks to be implemented.
- Subnet masking used.
Finally, we have reached the end of this post, stay tuned for the next post related to OSPF protocol.
Aric is a tech enthusiast , who love to write about the tech related products and ‘How To’ blogs . IT Engineer by profession , right now working in the Automation field in a Software product company . The other hobbies includes singing , trekking and writing blogs .