Options

RIP encapsulation

daniel2009daniel2009 Member Posts: 20 ■□□□□□□□□□
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?)

Comments

  • Options
    tndfrtndfr Member Posts: 110
    daniel2009 wrote: »
    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?)

    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.
    Working on CCNP 642-813 and finishing off MCSA.
  • Options
    tndfrtndfr Member Posts: 110
    daniel2009 wrote: »
    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?)

    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.
    Working on CCNP 642-813 and finishing off MCSA.
  • Options
    luke_bibbyluke_bibby Member Posts: 162
    My understanding is that the header contents would be:

    L2 header - EtherType = 0800 (IP)
    L3 header - IP Protocol = 17 (UDP)
    L4 header - UDP Destination Port = 520 (RIP)
  • Options
    daniel2009daniel2009 Member Posts: 20 ■□□□□□□□□□
    Seems RIP is just a sub-part of the UDP protocol ( List of TCP and UDP port numbers - Wikipedia, the free encyclopedia )
    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?
  • Options
    LBC90805LBC90805 Member Posts: 247
    daniel2009 wrote: »
    Seems RIP is just a sub-part of the UDP protocol ( List of TCP and UDP port numbers - Wikipedia, the free encyclopedia )
    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.
  • Options
    daniel2009daniel2009 Member Posts: 20 ■□□□□□□□□□
    I've been reading the documentation of "routed" (can't find the sourcode anywhere tho) and RIPv1

    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:
    class Program
    {
    static void Main(string[] args)
    {
    /* Initialize RIP server, and start RIP client threads somewhere else */
    int recv;
    byte[] data = new byte[1024];
    IPEndPoint ipep = new IPEndPoint(IPAddress.Any, 520);


    Socket newsock = new Socket(AddressFamily.InterNetwork,
    SocketType.Dgram, ProtocolType.Udp);

    newsock.Bind(ipep);
    /* wait for clients (routers/pcs/switches) to connect */

    IPEndPoint sender = new IPEndPoint(IPAddress.Any, 0);
    EndPoint Remote = (EndPoint)(sender);

    /* handle RIP messages now.
    listen and send/request RIP messages.
    */

    recv = newsock.ReceiveFrom(data, ref Remote);
    Console.WriteLine("RIP message received from :", Remote.ToString());


    }
    }

    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?
  • Options
    daniel2009daniel2009 Member Posts: 20 ■□□□□□□□□□
    Its part of the kernel, as it uses the interfaces. However doesnt matter wheter compiled in kernel or as module/driver.

    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!
  • Options
    s_nivas2ks_nivas2k Member Posts: 2 ■□□□□□□□□□
    As I know RIP messages are encapsulated in UDP datagrams.a RIP message doesn’t include a field that indicates the length of the messages.This can be determined from the UDP packet.The well known port assigned to RIP in UDP is port 520.
  • Options
    s_nivas2ks_nivas2k Member Posts: 2 ■□□□□□□□□□
    Due to usage of UDP Transport protocol,RIP not able to provide reliability,so we are achieving reliability with triggered updates and also with timers mechanism...
Sign In or Register to comment.