Sunday, August 21, 2016

Leave a Comment

Router Packet Forwarding

The Term packet switching is use to describe the routing of a packet from incoming interface on router to outgoing interface
                                                      Let’s now consider what’s going on inside of router architecturally as say, packet flows in the input, the ingress interface on a router and get routed to output or egress interface on a router.

We have different frame forwarding option: -
We wanna look at 3 major one in this topic: -


Process Switching: - With Process switching is we going to see, the router processor the CPU (Central Processing unit) gets involved with every packet forwarding decision. It gets quite a bit more efficient with fast switching. In Process switching router architecture dividing into two Plane “Control Plane and Data Plane
The Data Plane is where our traffic is actually flowing through the router

The Control Plan is gonna be handling behind the seems tasks and we have a CPU the router processor that can do working both of these planes.

                                                      However, if the CPU became involved in every single packet forwarding decision. That’s not terribly efficient. We could overwhelm CPU with too much traffic. However, that’s exactly what processing switch does. This is the oldest approach to forwarding packet to router.
                                                         Let’s imagine that we have a packet coming in to this router incoming interface or the ingress interface. With Process Switching every single packet has to go up to CPU.
And we ask the CPUhow do we route this packet” and CPU has to take a look the routing table and say “that packet is gonna go out of this particular interface” So the CPU is gonna direct the packet to leave via the outgoing interface.


That’s Process switching and because of CPU is involved in every single packet, routing, packet switching, decision. It is not very efficient

Let’s look at much more efficient approach that’s called “Fast Switching”
With Fast Switching we have another architecture component. The “Route Cache”.
That can learn how we have previously routed a packet to a specific network.
                                            For example, let’s say “A packet comes into the router and its destined for a network that, we have not yet routed the packet too. Since we never done it before, we go ask CPU “how we route to his network”

The CPU is gonna do lookup its IP Routing Table and says” To go out this egress interface”. But here what happened. The CPU is going to cause that entry that says” to go to this network go out of this interface”. That information is gonna be written into the Route Cache.
And that first packet it is gonna be routed out to the destination network.
But now that information has been stored in to Route Cache. What happened, if second packet comes in and destined for that network. Since we done it before, since we learned, since we cache the information. That say’s” packet going to this network go out of this interface”. We don’t need to ask CPU, we can simply query the Route Cache and says “how do we route traffic”, going to this network”.
And Route Cache says” Oh! Yaw, I seen that before we gonna go out of this interface”.



That’s the concept of “Fast Switching

Interestingly There is more efficient approach: - 
With CEF (Cisco Express Forwarding), we don’t have to ask the CPU for first time we trying to route a packet to a specific destination network, because with CEF, the CPU is going to proactively populate the FIB (that’s the Forwarding Information Base, that’s the Layer 3 information).
It essentially got the IP Routing table information in memory in this FIB, and very efficient table structure, where lookup information very very rapidly. That’s Layer 3 information but we also need some Layer 2 information, that will allow us to quickly foam a frame header. So for example, the FIB says “to go to this network, go to this next-hop ip address”. Well the Adjacency Table can say “To get to that next-hop ip address” we need to go out this interface, we gonna be using this “encapsulation type”, and here is destination mac-address.
So Adjacency Table and FIB Table, they provide all of the information we need to route a packet. The Packet comes in incoming interface even, if we never routed to this network before. We don’t ask the CPU how to get there, we just go to ask the FIB and Adjacency Table.
We ask CEF, and CEF has learned all this information, and CEF is gonna be directly out this appropriate egress interface.
                                                              This is gonna be most efficient approach to doing Packet Switching, because we never had to ask the CPU how I had get to the destination network. By the way There is change in network, if there is change in ip routing table then CEF it gonna be updated through reflect that

So CEF is a very CPU friendly approach to Packet Switching 




If You Like the Post. Don’t forget to Subscribe/Share/Comment. Thank You.

0 comments:

Post a Comment