RIP encapsulation

in CCNA & CCENT
RIP messages get encapsulated into
The Data Link Frame Header
IP Packet header
UDP Segment header
RIP Message
Does the RIP protocol code encapsulate the data link frame header, ip packet header, udp segment header and rip message. Or is the encapsulating done by 4 codes (ip protocol, udp protocol code, rip protocol code, and one other?)
The Data Link Frame Header
IP Packet header
UDP Segment header
RIP Message
Does the RIP protocol code encapsulate the data link frame header, ip packet header, udp segment header and rip message. Or is the encapsulating done by 4 codes (ip protocol, udp protocol code, rip protocol code, and one other?)
Comments
as far as i know any ethernet packets going through ethernet routers go through the usual OSI layer encapsulation, different protocols reside at different layers.
i dont really know the specific how a RIP packet is actually formed i.e. the header, the flags, crc etc... all i can say is that RIP v1 is broadcasting to neighbors and RIP v2 is Multicasting.
as i come from a programming background i was as interested as you in this question, from RFC 1058 RIP is a UDP based protocol with 520 ports. you can get the rest from the RFC page.
L2 header - EtherType = 0800 (IP)
L3 header - IP Protocol = 17 (UDP)
L4 header - UDP Destination Port = 520 (RIP)
I guess the UDP protocol code is a really big part of the IOS, in which RIP is a sub-part.
So the encapsulation is done by RIP sub-routing protocol of UDP routing protocol and IP (Internet Protocol)
Or am I understanding wrong?
Are the other protocols supported in the Cisco IOS?
for example, can a router do ssh?
Think of Cisco IOS as being Like Windows. Its just an Operating System that runs on Cisco machinery.
Don't think of RIP as being a sub part of UDP. UDP is just part of TCP/IP that works in the fourth layer; Transport layer, as does TCP. IP sits in the layer below TCP and UDP, the third layer, the Network Layer.
And yes, SSH runs on all Cisco Devices. It is what is used to keep communicating with routers and switches secured and encrypted over a network.
You are right, it seems they really are seprate protocols. RIP makes use of a protocol that already exists (UDP protocol and IP protocol).
In order to make a RIPv1 implementation, you'd need to make use of already existing IP and UDP protocol. With routed one can use their pc as router, is RIP supported by default in windows?
As far as I understand it, each IGP routing protocol is a server program.
To connect to mulitple routers at the same time it would need client threads. Beneath it can be a database or array in memory to store the routing table.
In a C# program the RIP server would be something like this:
The RIP server would be running on port 520. And ofcourse the RIP client threads can't guess the ports to conenct to neighboring routers so it will be 520 aswell.
Do I understand it right?
I checked the source of routed (srouted) 0.0.1, it are arbout 10 C files and not that difficult to understand as its well documentated.
In routed.h are all details about RIP
( 1 = request, 2 reply, 3 =... ). Also the hop count, count to infinitiy. all the protocol variables are in this header file.
It si quite interesting to see how it all works.
Thanks for your help everybody!