![]() "how does my computer know the IP of the router when only the gateway address is configured" :Įach connected machine will know the address of his "next-hop" ip (gateway). Having a set of rules (static set up or dynamically set up (routing protocols)) the router know to send the packets on a specific interface in order for those packets to reach the desired networkĪnd to answer specifically to your question: If you will, it can be said that the gateway "impersonates" the private IP machines with regard to the internet.Ī router OTOH just rutes packets from one interface to the other. Usually the "gateway" is a machine that make NAT "masquerading" and that means that the gateway send out the request for data in the name of private IPs for which the respective machine is gateway, and when the data is back, pass the data to those private IPs. Thus it can be seen that every host makes a routing choice of its own prior to sending out packets (of course this data is cached so lookups are not occurring for every single packet). In answer to your question about getting out to somewhere that is not on the local subnet, is again correct about the ICMP redirects, in addition, the process that a host goes through when sending out a packet is this:ġ - Use own IP address and mask to check if destination packet's IP address is in local subnet.Ģ - If destination in local subnet, send ARP request for MAC address of that local device then send frame to host.ģ - If destination not in local subnet, send ARP request for MAC address of gateway to that network then send frame to gateway for onward forwarding (at which point the point about ICMP redirects may kick in). There is no difference in TTL between a "default gateway" and a router, once a device which is doing routing passes an IP packet from one network/subnet to another it must decrement the TTL, that is made quite clear in the relevant RFC.Ī gateway need not be doing NAT, typically a home network will have a default gateway that is a router connected to ADSL, that type of device will do NAT, whereas the default gateway on your subnet at work will just lead to the wider office LAN and will not do NAT. Thus a gateway can be a router and a router can be known as a gateway. ![]() The term "gateway" has other connotations that are not relevant for the file and command in your is absolutely correct with his answer ("a router and a gateway are essentially the same"), some other responders are confusing the terms or, to put it kindly, have misunderstood the question (or wikipedia).Īs far as routing goes the term "gateway" is almost only ever used in conjunction with "default", and that "gateway" provides a route to every network for which there is no more specific route available.īy definition then, the gateway must be a device that does routing, it could be a dedicated device, specifically a router, or a host which has been configured to route, but it is doing the same job. ![]() The command netstat -nr on your PC will reveal both the static routes it learned from it's configuration files and the dynamic routes it learned by ICMP redirects or by listening to routing protocol broadcasts/multicasts. PC will add this to it's routing table, hence R1 won't show in a subsequent traceroute. If router R1 is PC's default gateway, when PC first tries to contact Google, PC will send data to R1 (as PC knows Google's IP-address is not in PC's subnet), However R1 will tell the PC that a more appropriate route to 64.20.60.99 is via router R2. If your LAN has multiple routers, the router designated as a default gateway can notify your computer, using an ICMP redirect or other mechanism, of a more appropriate route for a given destination. The term " default gateway" is used to mean the router on your LAN which has the responsibility of being the first point of contact for traffic to computers outside the LAN. ![]() A gateway and a router are essentially the same. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |