Subnetting math-how it gets from external ip to another
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Subnetting math-how it gets from external ip to another
Hey everyone,
I was recently asked this question and since its not my fortay, I thought I'd see if you guys could work this one out or give me some direction on howto work it out.
Using the IP subnet 142.25.97.0 and the subnet mask 255.255.255.0, show in detail how a packet from an external source destined for the IP address 142.25.97.100 successfully reaches its destination.
In my opinion you really have to know something about the structure you're traversing before you can answer that question. Unless you want an over generalisation?
Still seems like there's something missing and the question is incomplete. (looks like a bad homework question imho) ..
is it going through one router ?
multiple routers ?
coming from another private network ?
coming from the Internet ?
is it going through a NAT device ?
is the external source in the same network, and you are supposed to break down the packet process itself using the OSI or Internet model showing the encapsulation steps through the hardware transport, delivery, and de-encaspsulation of the datagram ?
or is this purely a Layer 3 exercise ?
Would be easier with a network diagram, and a source address.. without that my Firewall is just going to drop the packet anyway, and it will never be delivered.
Honestly if I knew I'd tell you, ya some lame theoretical crap. I think whats being asked is just basic packet flow.. I basically quoted the question word for word. It leaves much to be desired in terms of what is expected.. Nating, Mac address translation etc.. It is coming from the internet and going to that address of 142.25.97.100. Maybe that helps, I am dumbfounded with this question.
Hey everyone,
I was recently asked this question and since its not my fortay, I thought I'd see if you guys could work this one out or give me some direction on howto work it out.
Using the IP subnet 142.25.97.0 and the subnet mask 255.255.255.0, show in detail how a packet from an external source destined for the IP address 142.25.97.100 successfully reaches its destination.
Any ideas?
thanks,
Ronnie
It looks to me like a question you would find on a Microsoft certification test. The information they provide you with has very little to do with the answer they are looking for.
How a packet sent from one host to another using TCP/IP reaches it's final destination is basically same regarless of the destination IP address.
Assuming Ethernet, the steps would be something like this:
The source host uses it's subnet mask to determine if the destination IP address is on it's own subnet. It it is, it checks it's ARP cache for the MAC address of the destination. If found, it uses it. If it doesn't find it in ARP cache, it arps for the host's MAC address. Once it has the MAC address, it sends the packet with it's IP address as the source IP, the destination hosts IP as the destination IP and the destination hosts MAC address as the destination MAC address.
If the destination IP address is not on the same network, it then searches through it's route table for a route to that network. If it doesn't find one, it will fall through to the default route which will be it's default gateway. In that case, it checks it's ARP cache for the MAC address of it's default gateway. It uses it if it's there or arps for it if it's not.
Once it has the MAC address of it's default gateway, it sends out the packet using the same destination and source IP addresses as I mentioned above but this time, the destination MAC address is that of the default gateway.
When the default gateway receives it, it sees that the destination MAC address is it's own but the destination IP address is not. That's how it knows it needs to route the packet. It then looks through it's route table for a route and forwards the packet on. The packet will travel through the internet in the same way from router to router until it reaches the default gateway of the destination IP address. When that router receives the packet, it will discover that the destination IP address is on the network of one of it's ports. It gets the MAC address of the destination host via it's ARP cache or by arping. It then sends the packet using the same destination and source IP addresses as above but this time the destination MAC address is that of the destination host. Packet delivered.
It's the same process no matter what the source or destination IP address.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.