IP Routing Explained

Thanks Laz now understood.

But Could you explain packet flow eg like we type a google.com on web browser then how does packet flow from source to destination ?

Hello Pradyumna

A flow is a stream of packets that share the same characteristics like source/destination port, source/destination address, protocol, type, etc. So if you go to www.google.com with your web browser, all packets being exchanged between your PC and the web server have the same source and destination IP addresses, source and destination Transport Layer ports, and same application layer protocol (HTTPS for example). All of these packets are considered a flow.

I hope this has been helpful!

Laz

Hi Laz,

Thanks but you i wan to know whole process like ip routing b/c this is the question has been asked many times by interviewer for L2 or L3 position so please if you could describe the process kindly do it.

This time in your eg please add Switch and Firewall As well.

Hello Pradyumna

This is information that is found within the lessons under section 4.3 Routing within the CCNA 200-301 course. If you go through the lessons, you will gain a full understanding of what you’re looking for, in much more detail than I could write within a post. Take a look, and if you have any more specific questions, we’re here to help!

I hope this has been helpful!

Laz

Hi Rene and staff,

perhaps you remember i am studying IPv6 and this is a question about source routing in IPv4 versus IPv6; i found IP-routing lesson is the best place to ask my question

In IPv4, source routing is inserted in the options field of the IPv4 header (there are two modes but that does not matter for my question). Briefly, when a router processes a packet from source =S to destination =D (S and D in the IPv4 header), it looks if options are available in the header. When the router finds typical code (example 137 with strict source routing), it does not process with the RIB, it looks at the pointer to find the next router and it sends the packet to this router (briefly)
So, obviouly, the values of S and D in the IPv4 header remain the same as long as the packet follow its journey along the path

Now IPv6 do the same with the routing header extension. So i read RFC 2460 ( i know it is obsolete but it is not wrong until you find something in the errata) to understand the routing header specification; routing-type=0 is well described in section 4.4. Page 14, you find the routing header format, with some space to hold the routing path the packet has to follow: Address [1], Address[2], etc … Address[n]. The field “Segments left” seems to play like the pointer in IPv4

The question is:
how an intermediate router process an IPv6 packet with routing header extension ?

I though it was obvious that each intermediate router along the predetermined path has to process the routing header (if it exists) to find the next router to send the packet
But RFC 2460 says page 15:
“A Routing header is not examined or processed until it reaches the node identified in the Destination Address field of the IPv6 header”
Waouw, what is that ???
I would like to understand “the extensions that follow the routing header will not be processed by any intermediate router i there is a routing header”; that seems a good logic
But page 16, RFC 2460 gives an algorithm to explain how the routing header is processed, and page 17 gives an example
"The values of the relevant IPv6 header and Routing header fields on each segment of the delivery path would be as follows:
As the packet travels from S to I1:

    Source Address = S                  Hdr Ext Len = 6
    Destination Address = I1            Segments Left = 3
                                        Address[1] = I2
                                        Address[2] = I3
                                        Address[3] = D

As the packet travels from I1 to I2:

    Source Address = S                  Hdr Ext Len = 6
    Destination Address = I2            Segments Left = 2
                                        Address[1] = I1
                                        Address[2] = I3
                                        Address[3] = D

As the packet travels from I2 to I3:

    Source Address = S                  Hdr Ext Len = 6
    Destination Address = I3            Segments Left = 1
                                        Address[1] = I1
                                        Address[2] = I2
                                        Address[3] = D

As the packet travels from I3 to D:

    Source Address = S                  Hdr Ext Len = 6
    Destination Address = D             Segments Left = 0
                                        Address[1] = I1
                                        Address[2] = I2
                                        Address[3] = I3

Well, it seems that the destination address is modified in the IPv6 header as the packet follows its journey along the routing path ?

So i am lost, is not a basic rule that the dest address should not be modified in the L3 header ?

Could you clarify ?

Regards

Hello Dominique

Here are a few things that will help you (and helped me!!) to clarify what is going on.

First of all, as you mentioned, RFC2460 is indeed old, and it has been obsoleted by RFC 8200. You mention that it says that:

A Routing header is not examined or processed until it reaches the node identified in the Destination Address field of the IPv6 header

But this has been removed based on Erratum ID 4662.

The example you described further on in your post has also been removed. Even so, the changes you see from hop to hop seem to take place within the routing header and not within the main IPv6 header. Take a look at this pact capture to see this in action.

A couple of general comments. Reading RFCs is excellent to learn the details of how things work, but it’s always best to choose the most recent one to ensure the data is up to date.

Also, sometimes it’s easier (and more fun) to boot up some routers and test the functionality with packet captures to see the features in action.

I hope this has been helpful!

Laz

Hello, Refering to the question, I do not understand why 192.168.10.0/24 fa1/0 and 192.168.0.0/16 fa1/1 can not be a good choice. Isn’t it so that 192.168.10.45 can be fitted in both of them? So why choosing only 192.168.10.32/27 fa0/1? I would appreciate if someone can help me. Thank you.

Hello Kevin

First of all I had to remove the image in your post because it violates our Terms of Service. Sorry about that! But I will answer your question.

The question states, if R1 is sending traffic to 192.168.10.45, the traffic is sent through which interface? In other words, which of the entries in the routing table will be used? Of course, the specific destination IP address matches 192.168.10.0/24 fa1/0 and 192.168.0.0/16 fa1/1 and 192.168.10.32/27 fa0/1. But the rule that is always used for routing is match the most specific prefix. In other words, match the routing entry that has the smallest range, or the smallest subnet size.

The most specific prefix in this case is 192.168.10.32/27 because it has a /27 subnet.

I hope this has been helpful!

Laz

Thank you very much for your help, i had reached to a death end in that question. You can remove the whole question if you want as I know the answer now.

1 Like

Hello,
In this lesson you demonstrated how packets are being forwarded.
What if there was a switch betwwen the router and the pc, was the switch transparent to the pc and the router on both layers (2&3).
I assume that if there was a switch, he would forward the frame without de-encapsulate it by looking into its mac-address table.

Hello Dor

If there was a switch between the router and the PC, this would not affect the IP routing process at all because routing occurs on Layer 3, and a switch functions on Layer 2. A switch would simply receive the frame and regenerate it and send it out the appropriate port. It does not change the IP header, or the Layer 2 Ethernet header at all. It will read the source and destination MAC addresses for the purpose of updating the MAC address table and switching the frame out of the appropriate port, but no changes will be made. More about switching can be found at the following lesson:

I hope this has been helpful!

Laz

Thank a lot.

Well, if i get it right, the frame header is not changing while being forwarded by the switch.

בתאריך יום ג׳, 29 בספט׳ 2020 ב-12:47 מאת Lazaros Agapides via NetworkLessons.com Community Forum <forum@networklessons.com>:

Hello Dor

Yes, that’s correct. The switch will only read the Ethernet headers and will not change them. Routers however will change the Ethernet headers, changing the source and destination MAC addresses on each hop along the path to the destination.

I hope this has been helpful!

Laz

Thank you for NetworkLessons.com. So very helpful.
Could you provide some more complicated examples of destination addresses and where they are routed to? More complicated like the one in Mohammad’s response Oct 2017 with /30 and /27 and /28 (and etc.) routes in the table.
Thank you. Tim

Hello Tim

Glad to hear that the lessons and the content on the site are helpful for you!! For additional examples of routing tables with various types of network sizes, take a look at this Cisco documentation. It includes routing tables with entries that are both statically configured and dynamically learned, as well as entries with varying prefix sizes:

I hope this has been helpful!

Laz

Thank you!

Funny, I read this page a couple days ago. It was helpful.

What it doesn’t do is give examples of the routing table in action.

I would like to see the table in action - here are addresses entering the router as source addresses in the packet header, and here is how the router thinks, and here is where the packet is sent to its destination/next hop.

Tim Yahr

Hello Tim

I understand what you mean. Going through the process of how a router takes a look at the destination IP of a packet and the process with which it matches an entry in the routing table is important. Take a look at the following two posts which describe these processes in more detail:

I hope this has been helpful!

Laz

Thank you very much! I appreciate your time and responses.

Tim Yahr

Hi Rene,

Although the explanation is very clear, I got a little bit confused when you explain what happens between R1 and R2 and how they use MAC addresses between themselves?
Isn’t it all true for the Ethernet connections only? Normally routers would (or maybe not?) be connected with serial links and therefore the HDLC would be used for Cisco routers. Am I right?
If this is a real life scenario then no MAC address would be used in communication between R1 and R2.
R2 would use MAC address only when connecting to LAN - switch or H2 in our case - through its ethernet configured interface, but not when using serial link point-to-point R1 to R2?

I went through this tutorial of yours and this is what came up when I started to analyze it thoroughly. I am also not sure what the standard today is. Do we use serial links for WAN connections or do we use Ethernet 1Gbps for small networks and 10 Gbps or 100Gbps between routers for large enterprises - that’s what I came across when reading some posts from network engineers?
If my assumptions are correct, then this model of IP routing would be correct for Ethernet WAN connection between routers only. In case of a serial link the HDLC would come into place and no MAC L2 would be used?

Thank you in advance for clarifying my doubts.
Marcin

Hello Marcin

In the example shown, Ethernet is the Layer 2 technology used, and this is why Rene referred to the MAC addresses being used for communication between the routers. Remember that network communication involves the encapsulation and decapsulation process within the OSI model and you can’t skip a step. So you need Layer 2 functionality. Now if a serial link was used, then yes, the Layer 2 operation would be different, without a MAC address involved, due to the different technology used.

There is no hard and fast rule about what kind of interface to use where, it all depends on your network requirements. In general, today GigabitEthernet is the most common standard for LANs where each workstation is connected at 1Gbps speeds. Uplinks to the distribution network are typically 10GigabitEthernet, but may be 40G or 100G or may use Etherchannel for another combination of speed. It depends on your budget and expected traffic. For WAN connections this too can vary depending on what kind of connection your ISP provides and how much you can pay for it.

It all comes down to balancing between budget and network needs.

I hope this has been helpful!

Laz