a very basic question about default route and default gateway

hi,

I am confused with these two term-default route and default gateway. I know the first one is where your machine/router send packet to as a last resort. Isn't that the same thing as default gateway?(ie. if my computer send packet to

formatting link
webserver , its not local and it dono where is it. So it send to default gateway.)

Can someone please clarify this for me?

Thanks in advance.

Reply to
Chris
Loading thread data ...

Default gateways are used by end hosts. Hosts that are not running routing protocols anyway. As you note, it's used by the hosts to punt the packets for delivery by the router.

Default routes are used by routers. It tells the router where to send the packet to *if* there are no matching routing table entry *AND* you are using the command "ip classless" Note that a default route can point to an interface, next-hop IP address, or another network.

ip route 0.0.0.0 0.0.0.0 serial0/0/0 ip route 0.0.0.0 0.0.0.0 192.168.1.1 ip route 0.0.0.0 0.0.0.0 172.16.0.0

In the last example, the router would initiate a recursive lookup to see what it's routing table says about 172.16.0.0. So if the routing table says "next hop address for all 172.16.0.0 destined packets is

10.10.10.1, then the 10.10.10.1 just became the default gateway for your router.
Reply to
Hansang Bae

But when i type in 'route print' under my windows command prompt, i get

Active Routes: Network Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 192.168.1.1

192.168.1.2 20 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1 192.168.1.0 255.255.255.0 192.168.1.2 192.168.1.2 20 192.168.1.2 255.255.255.255 127.0.0.1 127.0.0.1 20 192.168.1.255 255.255.255.255 192.168.1.2 192.168.1.2 20 224.0.0.0 240.0.0.0 192.168.1.2 192.168.1.2 20 255.255.255.255 255.255.255.255 192.168.1.2 2 1 255.255.255.255 255.255.255.255 192.168.1.2 192.168.1.2 1 Default Gateway: 192.168.1.1

====================================================== why its has a default route here while my computer is a end host connecting to a home router? Besides, default route is about routed protocal right? I thought routing protocol is about how router populating its route table.

Reply to
Chris

indeed, i've never heard what he just said written anywhere. be interesting if he had a source. I haven't only know a little theory though.

Computer does Routing. I don't quite get it yet. But it seems that each NIC is like a port on the router. I guess it'll receive packets from You the user, and from the 'Router' it's connected to. Though it only looks at Dest address.

127.0.0.1 is to do with the packet not going out the NIC. It's local host.

Default Route is certainly not about about RoutED protocol. (IP is a routed protocol). It's not about RoutING protocol either. Routing protocols like RIP and IGRP and OSPF populate the Routing table, but are not absolutely necessary. You may do it manually, and if you did so, you would still add a default route.

Reply to
q_q_anonymous

[snip]

No. Default gateway is where you send the packets to if you don't know where to send it. Default route is used by routers to send the packets to the next hop who - presumably - will know what to do with it since it is advertising a default route. You're getting wrapped around the axle with semantics.

By the way, ever wonder why the default route is always shown as

0.0.0.0 with a network mask of 0.0.0.0?
Reply to
Hansang Bae

So you think default gateway and default route have nothing to do with whether you're on a Gateway or Router. I think, either ay, you're doing Routing and Default Route means the same thing.

I haven't much experience but surely default route isn't what you think it is. If it were, then you' seem to me to be saying that every route is the default route, except for the default gateway. that is false!!

I'm sure, there is one default Route or Default gateway. It's where packets are forwarded "by default" i.e. if no other Dest NWs match.

Because it's the last thing that is tested and it wants to get everything. It has to be that. There is only one default route. It turns out being used for packets where the router hasn't received a dest NW advertised from another router to tell it where to forward the packet.

A Gateway is a Router. The terms default gateway and default router come from that. It's exactly the same. Default Route is probably a better term to use. It just makes more sense 'cos who cares if the default thingy is forwarding to a Gateway or a router. A gateway is a router - in that it does Routing - so call it a default route.

I could be VERY wrong. I just know a bit of theory. Don't take this as me saying you're wrong, i'm just persuing this argument to find the truth.

James.

Reply to
q_q_anonymous

In general, very simple devices (at least from an IP networking perspective) can get by with just an IP address, a subnet mask and a default *gateway*. For any given destination IP address, the device can easily determine using simple

32-bit boolean operations whether the desired destination is on the same network or someplace else. If same, it uses ARP to find the MAC address and sends the packet directly there. If different, it sends to the default gateway instead. This works fine for things like printers, webcams and the management ports of L2 switches. A device doesn't need to know anything about routing to use a default gateway.

In order to make use of a default *route*, a device needs to be running a routing process of some sort, and maintaining a routing table. In this case, the device looks up destination addresses in the routing table, to find the best match. This will be the entry with the longest netmask, that matches for the entire length of the mask. (To answer HB's question, the *default route* is always given with an all-zero mask because it does not have to match any bits of the address--it's a default. It's the last possible candidate, however, because all other entries in the table will have longer masks.)

Reply to
Mike Dorn

I understand what you mean, but, what is the source for that definition?

Interestingly a 'Home Router' even when it only has one entry for forwarding, still uses a routing table, and routing protocol.

A Network Printer would receive packets but yeah, I guess it'd send Just to say OK received fine or not, mandatory stuff- TCP segments. A Network Webcam would have to send packets, it's an input device. So yeah, makes sense. Just wondering where you picked up that definition. Also, seems strange that you seem to be suggesting that the terms Default Route and Default gateway have nothing to do with whether the device is a Gateway or a Router.

Reply to
q_q_anonymous

Sorry, I'm not quoting a book or anything, that's just how I remember it. (Of course, I could certainly be mistaken, as could anyone you read on Usenet.) Where I think you've missed the point, however, is in considering "gateway" and "router" to be two different kinds of real devices. A gateway is a conceptual device, and a router is a real device. In a typical configuration, a router serves as a gateway for other devices on its connected networks.

If you're a simple device sitting on a particular network somewhere, a gateway is the thing you need to send packets to in order to get them off of that network and into the rest of the universe. Since you don't have multiple interfaces and a routing table of your own, the entire IP universe is divided into only two kinds of addresses--those you can reach directly on your network, and those you need a gatway to reach.

That gateway might be a router. Alternatively, it could be a firewall, a load-balancer, or one of several other kinds of devices. All that matters is that it has one interface on your network, and some kind of rule system for forwarding packets. (Usually a routing table.) What kind of real-world device it is doesn't actually matter--for you, it's a gateway, and it will accept your packets and send them somewhere else. (Unless its rules tell it not to.)

Reply to
Mike Dorn

Thanks for the clarification. I've done some googling,

I think you're right when you talk of the generalness of a Gateway. A gateway just forwards. It may operate at any level - layer of the OSI.

But you missed that a Gateway translates. It doesn't just forward.

Layers 1-2 A Translation[al] Bridge is a gateway. (I think) - and that'd cover layers 1-2

Layer 3 A Router the translates is also a Gateway. (layer 3) - so in this case the forwarding is Routing.

Layers - layers 4-6 , (Practically, the Transport Layer of TCP/IP or SPX layer of Novell.) You have Gateways that operate at the transport layer and NW Layer - probably converting IETF's TCP/IP from into Novell's IPX/SPX (changing the network and transport layers).

Layer 7 - application layer And it seems that a Gateway that operates on the application layer is exactly what a proxy is.

In the case of the Network Printer and Network WebCam, they do Forward data, but since they don't translate, I wouldn't say they are Gateways. I'm not sure that you or anybody would.

In the case of the Router they are forwarding the data to, I wouldn't say "that is a Gateway as it is on the network and connects other devices to the network", or as you said "a gateway is the thing you need to send packets to in order to get them off of that network and into the rest " that sounds like a marketting definition of Gateway. (anything that connects anything else to the network).

Googling around, a Gateway *always* translates between protocols.

Cisco also say a Gateway translates, but they seem to limit their definition of Gateway more than anybody else. Cisco say "gateway In the IP community, an older term referring to a routing device. Today, the term router is used to describe nodes that perform this function, and gateway refers to a special-purpose device that performs an application-layer conversion of information from one protocol stack to another. Compare with router. "

I think an Application Layer Gateway is synonymous with a Proxy.

The device you tell the network webcam or network printer to communicate with, is a Router that may also be a 'Gateway' i.e. do translation. Since so many have LANS connected to the Internet. The Router does translation and is thus a Gateway. But that is because of the Translation Not because it's connecting Webcams and Printers to some other network. In this case, the translation is because the networks aren't alike. The LAN end of the Router uses 'Ethernet'. The WAN end uses whatever (HDLC or something).

Reply to
q_q_anonymous

So what came first the chicken or the egg?

It doesn't matter what the difference is. The function is the same. They both are a catch all for destinations not matching any other route. Windows has routes, routers have routes, mailmen have routes.

In light of the philsophical discussion there is a difference between default-network and default-gateway.

Reply to
Joel Salminen

they match the packet's dest ip to the dest network, find then next hop, or next step in the route, and forward the packet there. In that sense, they match a route though they really match (dest ip AND mask) to network ip and after matching that network, they read the next hop.

But if a computer wants to send a packet to a local comp, the frame goes to the switch and to the other comp, without ever hitting a router and it all happens at layer 2. So in the Networking sense of the word, the packet is certainly not going on a route. For example tyou wouldn't say that a switch/bridge routes a packet or frame. A more extreme case - you wouldn't say that a Hub/[multi port]Repeater routes a symbol or frame or signal (wouldn't 'even' say it routed a signal!, woudln't say it routed anything)!

Less significantly-

Regarding whether R1 is routing when sending a packet to a local interface / interfrace with a switch or computer, rather than router attached. A book I have has Next Hop as N/A when the next network is local. As if the word Hop only applies when the next step is a Router. That'd be annoying terminology-wise.

In the case of a computer with one NIC, the packet just goes down the 1 cable. But it gives the frame information so a switch will forward it correctly and the comp will know it's for him. If a device keeps sending the packet down the same cable, it's certianly not routing. (though i have heard of a one arm router, so i guess terms get redefined).

Most significantly-

As far as funcitinoality is concerned in choosing a route. I think it's simpler to talk of either a

Router or a Simple Layer 3 Forwarding Device (a device that just makes a boolean decision: if local network, send here, else , send there. OR, if local network, use that comp's MAC , else, use Router's MAC - all gets sent out same cable)

Whether the simple forwarding device is also a gateway. Or whether the Router is a gateway, is not relevant. As is the device its forwarding to.

Less significantly

Perhaps the term next hop, if it's restrictive(only refering to when the next step is a router?), is better replaced here by 'next step'!. Whether the device at the next step is to a simple forwarding device or to a router, is not really relevant. And whether that device is a gateway or not, is irrelevant. Perhaps it's not even relevant, whether that device is a Route or a Computer(or switch to computer) .

I don't know much about proxies, but I'm thinking maybe a general term would be proxy. But proxies don't necessarily search for destinations, do they? Also, some/all proxies let you tell them where to forward. they don't (necessarily ?) make the decision themselves. So proxy isn't an ideal term. Nobody refers to a router as a kind of proxy.

Reply to
q_q_anonymous

Well, almost...

Some routing protocols don't understand the concept of the default network 0.0.0.0.

Default route (network): The network listed in the router's table to forward packets with no match.

One could point towards a default network, and upstream, that route may be advertised by more than one router. If one router goes down, then the packet could be dynamically forwarded to the remaining node.

Default gateway: The single, final router of last resort (in Cisco parlance).

If you were to "force" the default gateway and it becomes unavailable, packets could get dropped.

The functionality of the two is to forward a packet on to a destination that the local router doesn't have a specific, local interface that the packet should be forwarded to. However, there is a subtle difference in operation and it matters depending on the protocols used in your routing environment.

Reply to
slim

You posted this response to the wrong person. You were responding to joel. He may not have noticed your response. You actually quoted Joel. Not me.

Reply to
q_q_anonymous

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.