Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Why does an IP addreess need to be associated with an interface?

  1. Mar 9, 2008 #1

    Eus

    User Avatar

    Hi Ho!

    On page 322 of Computer Network: A Top-Down Approach Featuring the Internet, 2nd Edition by Kurose and Ross, which is published by Addison-Wesley, it is stated that:

    "Because every host and router is capable of sending and receiving IP datagrams, IP requires each host and router interface to have its own IP address. Thus, an IP address is technically associated with an interface, rather than with the host or router containing that interface."

    Is it true that the reason why IP requires each host and router interface to have its own IP address is because every host and router is capable of sending and receiving IP datagrams?

    If suppose an IP address is technically associated with the host or router containing that interface, will this eliminate the capability of sending and receiving IP datagrams of every host and router? Of course not, but this reduces the role of the router to just merely a hub. Suppose a router has more than one interface, all of which has the same IP address, which is the IP address of the router. Then, whenever the router wants to route a datagram, the routing table that the router consults will show the same IP address for each interface through which it should forward the datagram. Therefore, the router will simply forward the datagram to all of the interfaces; it acts just like a hub.

    It can be argued that, since an IP address is not technically associated with an interface anymore, the routing table should store the code of each interface so that the router can forward the datagram through the right interface. This way the router can act as a router instead of a hub. However, the router will never be able to interconnect two or more different networks that have different netmasks. For example, one network has a network number 103.0.0.0 and a netmask 255.0.0.0. The other network has a network number 200.233.31.0 and a netmask 255.255.255.0. If the router has a network number of 103.0.0.0, datagrams from the second network will never reach the router, and vice versa.

    Therefore, the main reason to associate an IP address with each interface is to permit a router to interconnect two or more different networks with different network numbers, not because every host and router is capable of sending and receiving IP datagrams.

    What do you think?

    Best regards,
    Eus
     
  2. jcsd
  3. Mar 9, 2008 #2
    If you ever tried pinging a host, you would realize why they need an IP address. Hosts do provide services. The real reason is the originating IP of the packets. Interfaces can sit on the sub-net.
     
  4. Mar 10, 2008 #3
    I started to write a lengthy reply, but it boils down to this (you are essentially correct):

    Code (Text):

    1.1 -- [a] R [b] -- 2.1
                 [c]    
                   |
                 3.1
     
    The interfaces [a], and [c] on R cannot share an IP-address simply because they all reside on different subnets. There is no address that is valid on all 3 networks.

    Other than that I'm not sure exactly what you are saying. You cannot have routers that behave like hubs, they would generate an infinite amount of traffic (the internet is complex, there are many thousands of circular routes even at a core backbone level) as well as generate very serious security issues. Even small subnets dont use hubs for internal data anymore , they (the hubs) are too vulnerable to packet sniffing.

    On a non-routing host it is very possible to have identical IP-adresses on different interfaces to achieve certain effects, or even different computers with the same IP. This is used in clustering, to name something off the top of my head.

    k
     
    Last edited: Mar 10, 2008
  5. Mar 10, 2008 #4
    What kenewbie said, basically. A hub is basically just an electrical device; it's “dumb”, it doesn't know about what type of network it's on or anything about addresses, it simply repeats all of the transmissions it hears. Unlike a router a hub is not able to send and receive IP datagrams.

    The whole point of having a group of computers separated into networks (small address ranges) with routers between them is so that a single packet / message doesn't have to be re-transmitted to be heard by every computer (because you don't know where the computer with a particular address is if every computer can be anywhere in one big address range.)

    The router knows “The computers on network α have addresses that look like 172.126.xxx.xxx and the computers on network β have addresses that look like 192.168.115.xxx. So when I see a message on network α with a destination address beginning with 192.168.115… I know to transfer that message to network β. But I can leave all of the messages with ‘local’ addresses alone.”
     
    Last edited: Mar 10, 2008
  6. Mar 11, 2008 #5

    Eus

    User Avatar

    I just want to say that the reason why IP requires each host and router interface to have its own IP address is not because every host and router is capable of sending and receiving IP datagrams. But, the reason for that is to permit a router to interconnect two or more different networks with different network numbers. To back up this argument, I gave two examples in my first post.

    Yes, you are right! The fact that each interface can sit on different sub-nets is the reason why an IP address needs to be associated with each of the interface, not the host or the router having the interface.

    Thank you.

    So, the authors of the book didn't give the right reason, did they?

    Best regards,
    Eus
     
    Last edited: Mar 11, 2008
  7. Mar 12, 2008 #6
    They may or may not have given the correct answer, based on the context they said it in. The quote you posted, with no further context, is indeed incorrect.

    k
     
  8. Mar 13, 2008 #7

    -Job-

    User Avatar
    Science Advisor

    There would be complications on the link layer in shared mediums such as Ethernet. Which MAC address would an ARP query return?
     
  9. Mar 14, 2008 #8
    That should work just fine as far as I can tell. Router broadcasts who-has on all interfaces, and get a response on the appropriate one, containing the MAC. Then the router responds on that interface.

    k
     
  10. Mar 14, 2008 #9

    Eus

    User Avatar

    Here is the complete paragraph in which the authors wrote the argument:

    So, because the paragraph is about the connection of hosts and routers into the network, as what I have explained before, it is not apt to say the the reason that IP requires each host and router interface to have its own IP address is because every host and router is capable of sending and receiving IP datagrams.

    What do you think?

    Yup, you are totally right!

    Best regards,
    Eus
     
    Last edited: Mar 14, 2008
  11. Mar 14, 2008 #10
    Eus: That paragraph didn't make any sense what so ever. You are correct; the book not only makes it point poorly, but said point is even wrong.

    k
     
  12. Mar 14, 2008 #11

    -Job-

    User Avatar
    Science Advisor

    Maybe i'm not understanding the topic correctly, i thought what was being argued here was the possibility of a single host with multiple interfaces to have the same IP on all interfaces.
     
  13. Mar 14, 2008 #12
    I think that a confusing distinction here is whether we're talking about each interface having the same IP address on a single network, or each interface having the same IP address on a separate network. The first case wouldn't work as Job rightly points out. I think the second case is what Eus was getting at with the OP.
     
  14. Mar 15, 2008 #13

    Eus

    User Avatar

    Yup, you are right that in the first case when an ARP request packet has been broadcasted, the sender will receive multiple replies because an IP address is associated with a host/router having multiple interfaces. Maybe this is the reason of the authors.

    But, the ARP stuff is the concern of the data link layer and not the network layer. Since the network layer will not know anything about the data link layer, it should be okay to associate an IP address with the host/router having multiple interfaces instead of with each of the interface. Therefore, everything should work fine even in the first case because of the principle of network layer abstraction.

    I have sent this matter to the authors but I haven't gotten any reply yet.

    Best regards,
    Eus
     
  15. Mar 15, 2008 #14

    -Job-

    User Avatar
    Science Advisor

    Well, according to layer abstraction as well, the network layer doesn't see hosts, it sees interfaces. By design each interface in the network layer is addressable, and must have it's own IP for that purpose. I think you have somewhat of a circular argument going on.
     
    Last edited: Mar 15, 2008
  16. Mar 16, 2008 #15

    Eus

    User Avatar

    Ah, you are right! Yes, thank you for reminding me about that important fact.

    Yes, that is the reason that the authors of the book should have written:
    An IP address needs to be associated with each interface instead of with the host/router that has the interface because, according to the principle of the network layer abstraction, the network layer does not see the presence of host/router in the network; it sees the presence of the NIC.

    Nope! We are done.

    The conclusion is that the authors of the book didn't write the right reason why an IP address needs to be associated with each interface instead of with the host/router that has the interface.

    Best regards,
    Eus
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?