Protocol Dispute (Is OSPF L3 or L4?)

Unanswered Question
Oct 23rd, 2008

So a buddy of mine and I are disputing the actual layer OSPF runs at. He states OSPF is purely layer 3. I say OSPF is layer 4. Since IP is required for OSPF to work, the OSPF is encapsulated in IP. To me, if you encapsulate anything in a L3 protocol (IP) then in all reality it is L4 at that point -- and OSPF, as a protocol, implements it's own messaging rules as TCP or UDP would. So I consider that a transport protocol since OSPF is not using TCP or UDP. There is so much conflicting information out there that this is a total grey area! Anybody want to chime in? :) Thanks!

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
netia Thu, 10/23/2008 - 07:11

I am the buddy in this discussion. My point is routing protocols operate at Layer 3, they enable traffic to move between separate networks. It does not matter if they use upper layer protocols or features to communicate to each other, their purpose is to route traffic. By definition and appointment they reside in the Network Layer as defined. I thought the OSI model was a guide and looking at it i clearly see routing protocols in the network layer, besides BGP.

davidjohnmeier Thu, 10/23/2008 - 07:22

I still disagree with the verbage here in the 3rd sentence. Routing protocols don't actually "route" traffic. They build routing tables, but for them to be able to do that the network layer *must* be operational first. With that respect OSPF is dependent on a pair of network interfaces connected to the same physical or logical network and configured at L3 before it can do its job. At that point the router can reference the route table built by OSPF. If OSPF actually did the routing you'd have problems with running multiple routing protocols on a particular device. That is not the case because RIP, EIGRP, OSPF, BGP, etc. can live together peacefully because they just populate the routing, but they don't actually route themselves.

MUHAMMAD SHAHEEN Thu, 10/23/2008 - 07:29

Hi David and Jeffrey,

Jeffrey is correct as OSPF v4 is placed in L3 according to OSI. But having said this, the new revised RFC 2740 tells it also relys on interface rather than an IP subnet and is more closer to L2. Perhaps overlaping on L2, i think.

Please check this link

Hope this Helps....


ruwhite Thu, 10/23/2008 - 09:35

IMHO, what you are seeing here is the result of trying to force IP into the OSI model. IP was developed on a four layer model, and the routing protocols fit squarely within the third layer of that model--to route information through the network, including the provision of control plane information required to provide the routing.

In the OSI model, layer 3 actually includes the forwarding and the control plane protocols that provide for forwarding, so it's not a matter of how the control plane protocols are carried, it's a matter of what the protocol does.




Jon Marshall Thu, 10/23/2008 - 07:28

It is a tricky one. BGP/UDP use TCP 179 and UDP 520 respectively whereas EIGRP/OSPF use protocol numbers 88 & 89.

OSPF/EIGRP encapsulate their packets directly within an IP packet ie. they do not rely on anything above L3 whereas BGP/RIP do rely on the higher layers.

So it's important to distinguish between the purpose of a routing protocol and what layer this is working at ie. all routing protocols are concerned with routing traffic and this is a L3 function but the mechanics of how they go about doing this can be very different ie. OSPF/EIGRP are strictly L3 whereas BGP/UDP utilise the higher layers as well.

As you say it is a grey area :)


davidjohnmeier Thu, 10/23/2008 - 07:32

That's where I have a hard time buying into it... TCP and UDP are also referenced by protcol numbers in the IP header. The IP header has the "protocol" field and it will defined TCP, UDP, OSPF, etc... But, to me TCP is using IP as a vehicle and IP is L3, so TCP is riding L3, moving it up in the model. It's the same concept for OSPF (at least in my view). So then you get to EIGRP. EIGRP uses both, it has it's own protocol but uses TCP as well... Where is that then?

Jon Marshall Thu, 10/23/2008 - 07:42

IP has whole number of protocol numbers for example ICMP has a protocol number. I would never argue that ICMP works at any layer above layer 3, ditto GRE, ESP etc. These protcols encapsulate their packets directly into the IP packet and once the protocol number has been read you know what's in the IP packet ie. if the protocol number is 89 you know it's OSPF.

TCP is also a protocol but unlike GRE/ESP etc.. it has it's own set of ports within that protocol. So once you get the protocol number from the IP header you know it's TCP but you have no idea what applciation that is eg. telnet/SMTP/HTTP etc.. So further processing is needed.


davidjohnmeier Thu, 10/23/2008 - 07:50

Right... I understand that ICMP has a protocol number as well as TCP and UDP do to. My point is that TCP and UDP are always placed at L4 and, just like all of the other protocols, are encapsulated into the IP packet. I would assume that all of the defined in this list:

...would then be either defined as all L3 or all L4. Because, they're all using IP in the same manner, encapsulating themselves within IP. Even IP in IP. :) I think the OSI is horked when I start to try and wrap my head around this logically...

Jon Marshall Thu, 10/23/2008 - 08:07

Okay firstly i'm not a huge fan of the OSI model primarily because it does not map to the TCP/IP model.

So OSI has application/presentation/session/transport/network/data link/physical hardware

TCP/IP has

application/transport/internet/network interface

so there is no direct one-to-one mapping. The way i think of it is IP is concerned with getting a packet from A to B.

TCP/UDP is concerned with multiplexing the traffic from many different higher layer applications which are defined by port numbers. Anything that relies on TCP/UDP is by it's very nature working at the TCP/IP application layer. So BGP/UDP work in the Internet/Transport/application layer.

OSPF on the other hand does not rely on TCP or UDP. It does not sit in the application layer and therefore has no need of the transport layer ie. TCP/UDP so it resides purely in the internet layer.

EIGRP as you say is a funny one - enough said :)

I do understand what you are saying and i'm not saying you are right or wrong, i'm just saying the the OSI model is not the best model when discussing TCP/IP.


davidjohnmeier Thu, 10/23/2008 - 08:17

Well, the only reason I was classifying OSPF as transport was because it actually implements it's own checksum and ACK (something that TCP does). To me that's the workings of a transport protocol -- even though I realize that OSPF has more to the protocol than just that -- it's odd to me that if OSPF does similar functions to TCP plus some other specialized functions (i.e. route building) it would be operating at a similar level.

So what if I took TCP and modified it to add functions of OSPF to it? Since TCP already has ACK built in, I wouldn't need that -- but maybe look at adding in all of the OSPF messaging. At that point, would my modified version of TCP be moved back up to L3?

I think you said it best when you stated there is no direct one-to-one mapping and maybe we are beating a dead horse, because I still don't believe OSPF is true L3. :) I think IP is, and OSPF is riding IP.

So anyway, thanks for the feedback!


This Discussion