Unicast Routing Protocols A routing protocol is a combination of rules and procedures that lets routers in the internet inform each other of changes. It allows routers to share whatever they know about the internet or their neighborhood
Autonomous System(AS) An autonomous system is group of networks and routers under the authority of a single administration.. Routing inside an autonomous system is referred to as intradomain routing. Routing between autonomous systems is referred to as interdomain routing.
Autonomous systems
Popular routing protocols
Popular protocols Intradomain Routing Information Protocol(RIP) Open Shortest Path First(OSPF) Interdomain Border Gateway Protocol(BGP)
Distance vector routing In distance vector routing, the least cost route between any two nodes is the route with minimum distance. In this protocol each node maintains a vector (table) of minimum distances to every node
Distance vector routing tables
Initialization of tables in distance vector routing
Process Initializing Sharing Periodically Triggered update Updating
Issues Two node loop Instability Define infinity Split horizon Split horizon and poison reverse Three node instability
Routing Information Protocol The Routing Information Protocol (RIP) is an intradomain routing protocol used inside an autonomous system. It is a very simple protocol based on distance vector routing. Encapsulated in UDP user datagram
Example of a domain using RIP
RIP message format
Command Request—1 Response—2
Request messages
Timers in RIP
Periodic Timer Each router has periodic timer that is randomly set a number between 25 and 35. It counts down ;when zero is reached, the update message is sent, and the timer is randomly set once again.
Expiration Timer Expiration timer governs the validity of a route. Every route has its own expiration timer When a router receives update information for a route, the expiration timer is set to 180s If timer goes off, the route is considered expired and the hop count of the route is set to 16
Garbage collection timer When a route becomes invalid, the garbage collection timer is set to 120s Set the hop count value to 16 When the timer goes off, the route is purged from the table
RIP version 2 format
Link State Routing In link state routing, if each node in the domain has the entire topology of the domain, the node can use Dijkstra’s algorithm to build a routing table.
Building routing tables 1) Creation of the states of the links by each node called Link state Packet(LSP) 2) Dissemination of LSP to every other router called flooding 3) Formation of a shortest path tree for each node 4) Calculation of a routing table based on the shortest path tree
Link state packet Node identity The list of links A sequence number Age
Open shortest path first(OSPF) The Open Shortest Path First (OSPF) protocol is an intradomain routing protocol based on link state routing. Its domain is also an autonomous system.
OSPF Divides an autonomous system into areas An area is a collection of networks, hosts, and routers all connected within in an autonomous system. Routers inside an area flood the area with routing information.
Area Border routers At the border of an area, special routers called area border routers summarize the information about the area and send it to other area. Backbone Is a special area in an autonomous system. All other areas must be connected to backbone.
Areas in an autonomous system
Metric The metric can be based on a type of service- Minimum delay Maximum throughput Hop count A router can have multiple routing tables each based on a different type of service.
Types of Links In OSPF a connection is called a link
Point to point Connects two routers without any other host or router in between Transient Link is a network with several routers attached to it. The data can enter through any of the routers and leave through any router Sub link Is a network that is connected to only one router Virtual link When the link between two routers is broken, the administration may create a virtual link between them using a longer path that probably goes through several routers
Types of OSPF packets
OSPF common header
Version: 8 bit field current version 2 Type: 8 bit field: 5 types Message length: 16 bit: length of total message including header Source router IP addess: 32 bit: IP address of router that sends the packet Area identification: 32 bit: defines the area within which routing taking place Checksum: used for error detection: excluding authentication type and data field Authentication type: 16 bit: 0 or none and 1 for password Authentication: 64 bit: value of authentication data
Link sate packet update
Link state update packet
LSA general header
Link Stage age E flag: set to 1 means stub area. Means only one router between backbone area T flag: set 1 means router can handle multiple service Type : any of the five Advertising router: IP of router of LSA Link state sequence number Link state checksum: it is calculated using fletchers algorithm except for age Length: length of the whole packet
Hello Message OSPF Common Header 24 bytes type 1 Network Mask Hello intervalAll 0sETPriority Dead Interval Designated router IP address Backup Designated router IP address Neighbor IP Address(repeated)
Hello Message Network Mask: 32 bit defines network mask Hello interval: 16 bit: defines no of seconds between the messages E flag: if set – means stub area T flag: if set – router supports multiple service Priority: defines the priority of the router
Dead Interval: 32 bit: the number of seconds that must pass before a router assumes that a neighbor is dead Designated IP address: 32 bit: Backup Designated IP address: 32 bit: Neighbor IP address
Database description message When hello message is received for the first time from a router, the receiver router sends database description message. Only outline
Database description packet OSPF Common Header 24 bytes type 2 All 0s EB IMM/S Message Sequence Number LSA Header(20 Bytes) [repeated]
E flag: advertising router is an autonomous boundary router B flag: advertising router is area boundary router M flag: more flag, not the last message M/S: master/Slave : origin of the packet LSA Header:
Link state request packet Sent by a router that needs information about a specific route or routes Answered with a link state update packet
OSPF Common Header 24 bytes type 3 Link state type Link state ID Advertising router
Link state Acknowledgement Packet Every router must acknowledge the receipt of every link state update packet. OSPF Common Header 24 bytes type 5 LSA General Header
Path vector routing Path vector routing is similar to distance vector routing. There is at least one node, called the speaker node, in each AS that creates a routing table and advertises it to speaker nodes in the neighboring ASs..
Initial routing tables in path vector routing
Stabilized tables for four autonomous systems
Border Gateway Protocol(BGP) Border Gateway Protocol (BGP) is an interdomain routing protocol using path vector routing. It first appeared in 1989 and has gone through four versions.
Types of AS Three types Stub AS Multihomed AS Transient AS
BGP Sessions A session is a connection that is established between two BGP. Uses services of TCP
Types sessions External BGP Internal BGP E-BGP session is used to exchange information between two speaker nodes I-BGP session is used to exchange routing information between two routers inside an autonomous system
Internal and external BGP sessions
Types of BGP messages
BGP packet header Marker is for authentication
Open message
Keepalive Routers running BGP protocol exchange keepalive message regularly to tell each other that they are alive. Consist only the common header
Keepalive message
Notification Message A notification message is sent by a router whenever an error is detected or a route wants to close the connection
Notification message
Error codes
Update message
Update Message Is used by a router to withdraw destination that have been advertised previously. Announce a route to a new destination
Encapsulation BGP messages are encapsulated in TCP segments using the port number 179.