I have a query regarding encapsulation of OSPF & EIGRP packets into IP packet.As we know that RIP use UDP and BGP use TCP so we call them application layer routing protocols. My question is that in which layer OSPF & EIGRP lies and what is the format of encapsulted OSPF & EIGRP packets ? What is the difference in encapsulation process of these protocols as compare to RIP & BGP.
Yes OSPF data (and EIGRP data) travel as the payload of their IP packets. And OSPF packets and EIGRP packets do not contain UDP or TCP.
There are a number of situations where IP packets going through the network do not have TCP or UDP transport layer. For example protocol 47 is for GRE packets which do not use either UDP or TCP. And protocol 50 is for ESP (part of IPSec) which does not use UDP or TCP.
These protocols (including OSPF) do not need the services provided by the traditional transports of UDP or TCP.