LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Subnetting math-how it gets from external ip to another (https://www.linuxquestions.org/questions/linux-networking-3/subnetting-math-how-it-gets-from-external-ip-to-another-594390/)

Lantzvillian 10-24-2007 11:11 PM

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.

Any ideas?


thanks,
Ronnie

Centinul 10-25-2007 05:54 AM

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?

Centinul

Lantzvillian 10-25-2007 11:38 AM

I understand howto convert and make a subnet into binary and find the number of valid ranges etc. So I guess a generalization would do.

Thanks

farslayer 10-25-2007 11:50 AM

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. :p

archtoad6 10-25-2007 12:00 PM

1. Is this homework??

2. ipcalc

Lantzvillian 10-25-2007 03:13 PM

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.

archtoad6 10-25-2007 04:33 PM

Here's a good answer that probably won't pass:

"The consensus of the experts on LQ is that this is a bad Q too vague to be answerable."

Best I can do w/o more context.

Glad I'm not taking this class from this instructor, I'd fail for being in his/her face over bad texts or bad teaching or both. :)

cowanrl 10-26-2007 11:42 AM

Looks like a Microsoft test question
 
Quote:

Originally Posted by Lantzvillian (Post 2935914)
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.


All times are GMT -5. The time now is 02:38 PM.