cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
820
Views
25
Helpful
11
Replies

Would this packet loop for ever?

Ricky Sandhu
Level 3
Level 3

Hi all,  here is a simplified version of a network I am designing.  I have a single multilayer switch, connected to a router.  Switch points to the router for it's default route.  On the router I have a static route that points back to the switch for all RFC1918 addresses.

Say a host connected to the switch wants to send a packet to 10.1.1.1 IP address.  Switch performs a route lookup and notices it doesn't have a route for that network so it passes it onto the router (because of the default route). Router receives the packet, performs a route lookup and notices it must send to the switch for all RFC1918 destinations, so it reverts the packet back to the switch, which then bounces it right back.  My question,  would this packet loop forever between the router and the switch or would it get dropped eventually once the TTL expires?

11 Replies 11

Richard Burts
Hall of Fame
Hall of Fame

Every time the packet gets to a layer 3 device that must make a forwarding decision it decrements the TTL. And when TTL gets to zero the packet is dropped. So no the packet would not loop for ever.

HTH

Rick

pman
Spotlight
Spotlight

Hi,

about switch:
Ethernet switches don’t understand IP packets but frames.

- an IP packet has info for a router

- a frame has info for a switch.
switch does not look into the IP packet and forwards frame as is based on the destination MAC address.
switch checks the dynamic table in memory which stores Physical Port and MAC address pairs. Switch then knows which port to use to forward the frame.

about router:
your router use TTL (Time-to-Live) value in the IP datagram header to avoid Routing Loops.

When an IP datagram move from router to router, a router keeps track of the hops in the TTL field in the IP datagram header. For each hop a packet goes through, the packet’s TTL field is decremented by one. If this value reaches 0, the packet is dropped by the router that decremented the value from 1 to 0.

Therefore you should not have loops

@pman 

Your explanation of switches is correct however I mentioned my switch is a multilayer switch i.e. layer 3.  

for your Q,  it will drop after TTL is expire
for your design try add static route to null0 for some summary route (and also this done by default if you run OSFP or eigrp)
so can we see your config ?

Joseph W. Doherty
Hall of Fame
Hall of Fame

As the other posters have already noted, L3 will not loop forever, as TTL precludes that.  Of course, when @pman wrote  "your router use TTL (Time-to-Live) value in the IP datagram header to avoid Routing Loops." and "Therefore you should not have loops", he meant no "forever" loops, as he too well explained TTL processing in the same section.  I.e. transient loops can occur (and often do occur during a L3 topology convergence event).

If fact, assuming in your OP example, some sending source continues to transmit packets, each of those packets will loop between the router and L3 switch until TTL expires, which means the quantity of traffic on the loop transit links will also be increased by the TTL value.  Because of that, I suspect, TTL can be initially set less than the possible maximum TTL value, so L3 looping packets can be dropped sooner.  Also, of course, if initial TTL value is too small, packet will be dropped before it reaches its destination.

Also, BTW, as @pman mentions L2 switch processing, although he didn't mention frame looping, frames can loop forever (which is why L2 loops are so bad - especially if a sending source keeps providing more of them).  To handle a L2 active loop, generally you need to "break" the L2 loop path, which often might entail physically pulling a link out of its port or powering off a switch.  (Often, switches in a L2 loop situation are so overloaded, you cannot manage them, as you would normally.)

Ricky Sandhu
Level 3
Level 3

Thank you all for your insightful responses.  I appreciate all of them.  The situation I have is that I have a Layer 3 switch that forms an EIGRP relationship with a couple of Cisco routers.  Routers advertise internal routes to other branch offices to the switch. Routers are also running HSRP and the switch has a default-route to the Internet pointing to the HSRP IP address. I am now introducing an FTD appliance which will become the primary connection for the internet traffic.  Layer 3 switch already knows about all internal subnets via EIGRP from the routers.  It will now have a default route pointing to the FTD instead of the HSRP IP address.  

On the FTD I am going to place a static route for all RFC1918 addresses and point them back to the switch. 

I understood the TTL value but I wanted to make sure I wasn't going to cause a bigger problem.  However as one of the posters mentioned above,  I will try playing around with Null0 routes on the Layer3 switch to try and prevent it from sending packets to internal destinations that don't exist, to the FTD.

 

 

 

 

 

""Routers are also running HSRP and the switch has a default-route to the Internet pointing to the HSRP IP address.""
why static route when there is EIGRP ?

Static route is for default-route i.e. 0.0.0.0

So your environment is more complex that what is described in the original post. The suggestion about using null 0 routes is interesting. An alternative to consider would be to configure an access list on the switch interface connecting to FTD. In the acl you could deny any traffic which has a destination address in any RFC1918 network and permit everything else.

HTH

Rick

Thanks Richard.  That's an excellent point.  I'll try the ACL also.

if you have some RFC1918  that not connect to L3SW and you have a static route of RFC1918 in FTD point to L3SW 
then as I mention before, use static router to null0,
L3SW will do longest match and if not then the traffic will use null0 and drop and not return to FTD. 

Review Cisco Networking products for a $25 gift card