Are the IPv4 and IPv6 networks for my loopback interface the same network?2019 Community Moderator ElectionConfigure Atheros AR9285 wireless in Gentoo802.3ad on FreeBSD and Linux using crossover cables?Why would my Linux host suddently stop receiving multicast? All other nics on private network are receivingCannot connect to network in fedora 19Confusion about interfaces, iptables, connections, local connectionFTP not happening on RHEL 6 Server configured using a Vm Player 11I have no local IP on my CentOS 7.1 dedicated serverIPv6 packets injected on tun interface go up to IPv4 stackDebian8 server : Can't resolve IP adresses or DNSDirect connection Centos7 (loadbalance) to QNAP (trunk)

Did US corporations pay demonstrators in the German demonstrations against article 13?

What (else) happened July 1st 1858 in London?

Freedom of speech and where it applies

Would it be legal for a US State to ban exports of a natural resource?

Is there any significance to the Valyrian Stone vault door of Qarth?

How can I raise concerns with a new DM about XP splitting?

Is a naturally all "male" species possible?

Greatest common substring

What is the opposite of 'gravitas'?

How to be able to process a large JSON response?

Stereotypical names

Are taller landing gear bad for aircraft, particulary large airliners?

For airliners, what prevents wing strikes on landing in bad weather?

Why is delta-v is the most useful quantity for planning space travel?

Why does this part of the Space Shuttle launch pad seem to be floating in air?

How to deal with or prevent idle in the test team?

Latex for-and in equation

A Standard Integral Equation

Should my PhD thesis be submitted under my legal name?

Who must act to prevent Brexit on March 29th?

Perfect riffle shuffles

What will be the benefits of Brexit?

How to interpret the phrase "t’en a fait voir à toi"?

A social experiment. What is the worst that can happen?



Are the IPv4 and IPv6 networks for my loopback interface the same network?



2019 Community Moderator ElectionConfigure Atheros AR9285 wireless in Gentoo802.3ad on FreeBSD and Linux using crossover cables?Why would my Linux host suddently stop receiving multicast? All other nics on private network are receivingCannot connect to network in fedora 19Confusion about interfaces, iptables, connections, local connectionFTP not happening on RHEL 6 Server configured using a Vm Player 11I have no local IP on my CentOS 7.1 dedicated serverIPv6 packets injected on tun interface go up to IPv4 stackDebian8 server : Can't resolve IP adresses or DNSDirect connection Centos7 (loadbalance) to QNAP (trunk)










0















In output of ifconfig:



lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1552397 bytes 88437726 (88.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1552397 bytes 88437726 (88.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


netmask 255.0.0.0 indicate the network is 127.0.0.0/8, and consists many IP addresses



prefixlen 128 indicates the network has just one IP address. (https://networkengineering.stackexchange.com/a/57868/7894 seems to me that prefixlen specifies a network mask for IPv6)



Do they describe the same network?



Is a network defined as a set of IP addresses (therefore difference between IPv4 and IPv6 addresses can lead to different networks), or a set of network interfaces (therefore IPv4 and IPv6 addresses won't make difference, since they are assigned to the same network interfaces)?










share|improve this question



















  • 1





    Don’t think of loopback as a network, you’ll only end up confused.

    – Stephen Kitt
    Mar 22 at 13:42






  • 2





    On the other hand, Tim could just as well have asked this about a real network interface, so loopback being or not being a network is a bit of a red herring. I have a machine with a vio0 interface that has a /32 IP4 address and a /56 IP6 address about which Tim could ask the same question.

    – JdeBP
    Mar 22 at 13:50











  • the prefixlen refers to the ipv6 ::1 loopback, not to the ipv4 127.0.0.1/8. They're xompletely different things.

    – mosvy
    Mar 22 at 13:59












  • @mosvy "the prefixlen refers to the ipv6 ::1 loopback," do you mean prefixlen always specifies the current network interface, instead of a network? networkengineering.stackexchange.com/a/57868/7894 seems to me that prefixlen specifies a network mask for IPv6

    – Tim
    Mar 22 at 14:35












  • No. It specifies the length of the network part of an address, which for ::1/128 is 128. For the ipv4 127.0.0.1 with network mask 255.0.0.0 the prefix length is 8. ipv4 and ipv6 are different protocols, so I don't see how the question whether an ipv4 and an ipv6 address can be part of the same network makes any sense.

    – mosvy
    Mar 22 at 14:44















0















In output of ifconfig:



lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1552397 bytes 88437726 (88.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1552397 bytes 88437726 (88.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


netmask 255.0.0.0 indicate the network is 127.0.0.0/8, and consists many IP addresses



prefixlen 128 indicates the network has just one IP address. (https://networkengineering.stackexchange.com/a/57868/7894 seems to me that prefixlen specifies a network mask for IPv6)



Do they describe the same network?



Is a network defined as a set of IP addresses (therefore difference between IPv4 and IPv6 addresses can lead to different networks), or a set of network interfaces (therefore IPv4 and IPv6 addresses won't make difference, since they are assigned to the same network interfaces)?










share|improve this question



















  • 1





    Don’t think of loopback as a network, you’ll only end up confused.

    – Stephen Kitt
    Mar 22 at 13:42






  • 2





    On the other hand, Tim could just as well have asked this about a real network interface, so loopback being or not being a network is a bit of a red herring. I have a machine with a vio0 interface that has a /32 IP4 address and a /56 IP6 address about which Tim could ask the same question.

    – JdeBP
    Mar 22 at 13:50











  • the prefixlen refers to the ipv6 ::1 loopback, not to the ipv4 127.0.0.1/8. They're xompletely different things.

    – mosvy
    Mar 22 at 13:59












  • @mosvy "the prefixlen refers to the ipv6 ::1 loopback," do you mean prefixlen always specifies the current network interface, instead of a network? networkengineering.stackexchange.com/a/57868/7894 seems to me that prefixlen specifies a network mask for IPv6

    – Tim
    Mar 22 at 14:35












  • No. It specifies the length of the network part of an address, which for ::1/128 is 128. For the ipv4 127.0.0.1 with network mask 255.0.0.0 the prefix length is 8. ipv4 and ipv6 are different protocols, so I don't see how the question whether an ipv4 and an ipv6 address can be part of the same network makes any sense.

    – mosvy
    Mar 22 at 14:44













0












0








0








In output of ifconfig:



lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1552397 bytes 88437726 (88.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1552397 bytes 88437726 (88.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


netmask 255.0.0.0 indicate the network is 127.0.0.0/8, and consists many IP addresses



prefixlen 128 indicates the network has just one IP address. (https://networkengineering.stackexchange.com/a/57868/7894 seems to me that prefixlen specifies a network mask for IPv6)



Do they describe the same network?



Is a network defined as a set of IP addresses (therefore difference between IPv4 and IPv6 addresses can lead to different networks), or a set of network interfaces (therefore IPv4 and IPv6 addresses won't make difference, since they are assigned to the same network interfaces)?










share|improve this question
















In output of ifconfig:



lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1552397 bytes 88437726 (88.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1552397 bytes 88437726 (88.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


netmask 255.0.0.0 indicate the network is 127.0.0.0/8, and consists many IP addresses



prefixlen 128 indicates the network has just one IP address. (https://networkengineering.stackexchange.com/a/57868/7894 seems to me that prefixlen specifies a network mask for IPv6)



Do they describe the same network?



Is a network defined as a set of IP addresses (therefore difference between IPv4 and IPv6 addresses can lead to different networks), or a set of network interfaces (therefore IPv4 and IPv6 addresses won't make difference, since they are assigned to the same network interfaces)?







networking ip loopback






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 22 at 14:36







Tim

















asked Mar 22 at 13:38









TimTim

28.1k78269490




28.1k78269490







  • 1





    Don’t think of loopback as a network, you’ll only end up confused.

    – Stephen Kitt
    Mar 22 at 13:42






  • 2





    On the other hand, Tim could just as well have asked this about a real network interface, so loopback being or not being a network is a bit of a red herring. I have a machine with a vio0 interface that has a /32 IP4 address and a /56 IP6 address about which Tim could ask the same question.

    – JdeBP
    Mar 22 at 13:50











  • the prefixlen refers to the ipv6 ::1 loopback, not to the ipv4 127.0.0.1/8. They're xompletely different things.

    – mosvy
    Mar 22 at 13:59












  • @mosvy "the prefixlen refers to the ipv6 ::1 loopback," do you mean prefixlen always specifies the current network interface, instead of a network? networkengineering.stackexchange.com/a/57868/7894 seems to me that prefixlen specifies a network mask for IPv6

    – Tim
    Mar 22 at 14:35












  • No. It specifies the length of the network part of an address, which for ::1/128 is 128. For the ipv4 127.0.0.1 with network mask 255.0.0.0 the prefix length is 8. ipv4 and ipv6 are different protocols, so I don't see how the question whether an ipv4 and an ipv6 address can be part of the same network makes any sense.

    – mosvy
    Mar 22 at 14:44












  • 1





    Don’t think of loopback as a network, you’ll only end up confused.

    – Stephen Kitt
    Mar 22 at 13:42






  • 2





    On the other hand, Tim could just as well have asked this about a real network interface, so loopback being or not being a network is a bit of a red herring. I have a machine with a vio0 interface that has a /32 IP4 address and a /56 IP6 address about which Tim could ask the same question.

    – JdeBP
    Mar 22 at 13:50











  • the prefixlen refers to the ipv6 ::1 loopback, not to the ipv4 127.0.0.1/8. They're xompletely different things.

    – mosvy
    Mar 22 at 13:59












  • @mosvy "the prefixlen refers to the ipv6 ::1 loopback," do you mean prefixlen always specifies the current network interface, instead of a network? networkengineering.stackexchange.com/a/57868/7894 seems to me that prefixlen specifies a network mask for IPv6

    – Tim
    Mar 22 at 14:35












  • No. It specifies the length of the network part of an address, which for ::1/128 is 128. For the ipv4 127.0.0.1 with network mask 255.0.0.0 the prefix length is 8. ipv4 and ipv6 are different protocols, so I don't see how the question whether an ipv4 and an ipv6 address can be part of the same network makes any sense.

    – mosvy
    Mar 22 at 14:44







1




1





Don’t think of loopback as a network, you’ll only end up confused.

– Stephen Kitt
Mar 22 at 13:42





Don’t think of loopback as a network, you’ll only end up confused.

– Stephen Kitt
Mar 22 at 13:42




2




2





On the other hand, Tim could just as well have asked this about a real network interface, so loopback being or not being a network is a bit of a red herring. I have a machine with a vio0 interface that has a /32 IP4 address and a /56 IP6 address about which Tim could ask the same question.

– JdeBP
Mar 22 at 13:50





On the other hand, Tim could just as well have asked this about a real network interface, so loopback being or not being a network is a bit of a red herring. I have a machine with a vio0 interface that has a /32 IP4 address and a /56 IP6 address about which Tim could ask the same question.

– JdeBP
Mar 22 at 13:50













the prefixlen refers to the ipv6 ::1 loopback, not to the ipv4 127.0.0.1/8. They're xompletely different things.

– mosvy
Mar 22 at 13:59






the prefixlen refers to the ipv6 ::1 loopback, not to the ipv4 127.0.0.1/8. They're xompletely different things.

– mosvy
Mar 22 at 13:59














@mosvy "the prefixlen refers to the ipv6 ::1 loopback," do you mean prefixlen always specifies the current network interface, instead of a network? networkengineering.stackexchange.com/a/57868/7894 seems to me that prefixlen specifies a network mask for IPv6

– Tim
Mar 22 at 14:35






@mosvy "the prefixlen refers to the ipv6 ::1 loopback," do you mean prefixlen always specifies the current network interface, instead of a network? networkengineering.stackexchange.com/a/57868/7894 seems to me that prefixlen specifies a network mask for IPv6

– Tim
Mar 22 at 14:35














No. It specifies the length of the network part of an address, which for ::1/128 is 128. For the ipv4 127.0.0.1 with network mask 255.0.0.0 the prefix length is 8. ipv4 and ipv6 are different protocols, so I don't see how the question whether an ipv4 and an ipv6 address can be part of the same network makes any sense.

– mosvy
Mar 22 at 14:44





No. It specifies the length of the network part of an address, which for ::1/128 is 128. For the ipv4 127.0.0.1 with network mask 255.0.0.0 the prefix length is 8. ipv4 and ipv6 are different protocols, so I don't see how the question whether an ipv4 and an ipv6 address can be part of the same network makes any sense.

– mosvy
Mar 22 at 14:44










2 Answers
2






active

oldest

votes


















3














It depends on which abstraction layer you're looking at.



If we look at L3 of the OSI model, the IPv6 and IPv4 sides of the loopback interface are completely separate: there is no routing functionality between the two (unless you explicitly set it up). There is an optional (enabled by default, but switchable per socket) mapping of the entire IPv4 address space to a subset of the IPv6 address space, but you need to be at L4 or above to make use of it.



On an actual physical NIC, we could also look at L2 and the physical layer, and see that both L3 protocols are actually sharing the same Ethernet media and MAC addresses, and are therefore "the same network" in L2 sense. But a loopback interface does not have a L2 layer, let alone a physical layer.



Fundamentally, the loopback interface is a shortcut at the L3 level from the outgoing side of the IP (either IPv4 or IPv6) driver stack to the incoming side. When an application wants to communicate with another application using the network protocols, and both applications happen to be in the same host, the loopback interface allows the traffic between them to be routed more efficiently, without unnecessarily passing back & forth through the entire depth of the network protocol stack.



Sometimes applications want to allow some traffic only within the single host, or only on a specific physical NIC: for this purpose, it is useful to have the host-internal shortcut be presented as a L3 network interface, so the higher-level protocols can just use it like any other network interface without needing to implement a special case.






share|improve this answer

























  • Is it really routing though? Or is it a sort of mapping in the interface between L3 and L4? I don't think I can make an IPv6 routing table entry and have it affect where the system routes IPv4 packets. Also, applications can opt out of the mapping by using the IPV6_V6ONLY socket option, and the administrator can set the system-wide default by using /proc/sys/net/ipv6/bindv6only.

    – telcoM
    Mar 22 at 17:02











  • I just wanna ask why do people analize the network strusture using OSI model. It's not used in the real world. Such answers are too unfriendly.

    – 炸鱼薯条德里克
    2 days ago


















0















Q: Is a network defined as a set of IP addresses (...), or a set of network interfaces (...) ?




My opinions:



You cannot really define a network in terms of IPv6 addresses. The concept "a set of network interfaces" is more useful. See the definition of "link" below.



This precise definition for "network" might not be widely agreed enough. So it might not be a useful term in your question.



This differs from working with IPv4. In the IPv4 world, the term "subnet" was more common and useful.



My reasoning:



RFC 8200 starts with an introduction, and then definitions of 11 key terms. They do not include "network", but they do include "link".




link: a communication facility or medium over which nodes can
communicate at the link layer, i.e., the layer
immediately below IPv6. Examples are Ethernets (simple
or bridged); [...]



interface: a node's attachment to a link.




All interfaces share the exact same prefix for link-local unicast addresses: fe80::/10. Different hosts on different links can use the same link-local address. At a user level, you have to specify which link you want, by including an interface specifier. E.g. ping fe80::1234%lo .



Link-local addresses can be ignored in many cases. However they are an essential part of how IPv6 works:



When you run a standard IPv6 Local Area Network through an L2 Ethernet "switch" (or switches), the routable unicast addresses have to be resolved using Neighbour Discovery packets. ND packets are are sent using link-local addresses. [1]



Notes



  • The ip link command is for "network device configuration". In other words, the command "ip link" is actually used to configure interfaces :-).



  • A "loopback interface" like lo is contrived by the operating system. The IPv6 standards say that ::1 may be assigned to




    a virtual interface (typically called the "loopback interface") to an imaginary link that goes nowhere.




    It does not tell you exactly how this will be implemented e.g. in Linux. I think there are some weird questions you can ask about this, but the answers do not really tell you very much.



  • You can still get away with thinking in IPv4 terms a lot of the time. But IPv6 adoption is increasing. It is good to at least try to learn IPv6 equivalents, when you are learning about specific IPv4 features. Realistically, you will probably see some terms used for IPv4, and some different terms used for IPv6. You will not always know a generic definition that can account for both IPv4 and IPv6.


  • [1] Neighbour discovery actually uses both unicast and multicast link-local addresses. E.g. ND requests are usually sent from a unicast address, to a multicast address. Link-local multicast addresses are perhaps not as simple as the unicast ones. They are the multicast addresses where the "scop" part is set to link-local.






share|improve this answer
























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f507991%2fare-the-ipv4-and-ipv6-networks-for-my-loopback-interface-the-same-network%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    It depends on which abstraction layer you're looking at.



    If we look at L3 of the OSI model, the IPv6 and IPv4 sides of the loopback interface are completely separate: there is no routing functionality between the two (unless you explicitly set it up). There is an optional (enabled by default, but switchable per socket) mapping of the entire IPv4 address space to a subset of the IPv6 address space, but you need to be at L4 or above to make use of it.



    On an actual physical NIC, we could also look at L2 and the physical layer, and see that both L3 protocols are actually sharing the same Ethernet media and MAC addresses, and are therefore "the same network" in L2 sense. But a loopback interface does not have a L2 layer, let alone a physical layer.



    Fundamentally, the loopback interface is a shortcut at the L3 level from the outgoing side of the IP (either IPv4 or IPv6) driver stack to the incoming side. When an application wants to communicate with another application using the network protocols, and both applications happen to be in the same host, the loopback interface allows the traffic between them to be routed more efficiently, without unnecessarily passing back & forth through the entire depth of the network protocol stack.



    Sometimes applications want to allow some traffic only within the single host, or only on a specific physical NIC: for this purpose, it is useful to have the host-internal shortcut be presented as a L3 network interface, so the higher-level protocols can just use it like any other network interface without needing to implement a special case.






    share|improve this answer

























    • Is it really routing though? Or is it a sort of mapping in the interface between L3 and L4? I don't think I can make an IPv6 routing table entry and have it affect where the system routes IPv4 packets. Also, applications can opt out of the mapping by using the IPV6_V6ONLY socket option, and the administrator can set the system-wide default by using /proc/sys/net/ipv6/bindv6only.

      – telcoM
      Mar 22 at 17:02











    • I just wanna ask why do people analize the network strusture using OSI model. It's not used in the real world. Such answers are too unfriendly.

      – 炸鱼薯条德里克
      2 days ago















    3














    It depends on which abstraction layer you're looking at.



    If we look at L3 of the OSI model, the IPv6 and IPv4 sides of the loopback interface are completely separate: there is no routing functionality between the two (unless you explicitly set it up). There is an optional (enabled by default, but switchable per socket) mapping of the entire IPv4 address space to a subset of the IPv6 address space, but you need to be at L4 or above to make use of it.



    On an actual physical NIC, we could also look at L2 and the physical layer, and see that both L3 protocols are actually sharing the same Ethernet media and MAC addresses, and are therefore "the same network" in L2 sense. But a loopback interface does not have a L2 layer, let alone a physical layer.



    Fundamentally, the loopback interface is a shortcut at the L3 level from the outgoing side of the IP (either IPv4 or IPv6) driver stack to the incoming side. When an application wants to communicate with another application using the network protocols, and both applications happen to be in the same host, the loopback interface allows the traffic between them to be routed more efficiently, without unnecessarily passing back & forth through the entire depth of the network protocol stack.



    Sometimes applications want to allow some traffic only within the single host, or only on a specific physical NIC: for this purpose, it is useful to have the host-internal shortcut be presented as a L3 network interface, so the higher-level protocols can just use it like any other network interface without needing to implement a special case.






    share|improve this answer

























    • Is it really routing though? Or is it a sort of mapping in the interface between L3 and L4? I don't think I can make an IPv6 routing table entry and have it affect where the system routes IPv4 packets. Also, applications can opt out of the mapping by using the IPV6_V6ONLY socket option, and the administrator can set the system-wide default by using /proc/sys/net/ipv6/bindv6only.

      – telcoM
      Mar 22 at 17:02











    • I just wanna ask why do people analize the network strusture using OSI model. It's not used in the real world. Such answers are too unfriendly.

      – 炸鱼薯条德里克
      2 days ago













    3












    3








    3







    It depends on which abstraction layer you're looking at.



    If we look at L3 of the OSI model, the IPv6 and IPv4 sides of the loopback interface are completely separate: there is no routing functionality between the two (unless you explicitly set it up). There is an optional (enabled by default, but switchable per socket) mapping of the entire IPv4 address space to a subset of the IPv6 address space, but you need to be at L4 or above to make use of it.



    On an actual physical NIC, we could also look at L2 and the physical layer, and see that both L3 protocols are actually sharing the same Ethernet media and MAC addresses, and are therefore "the same network" in L2 sense. But a loopback interface does not have a L2 layer, let alone a physical layer.



    Fundamentally, the loopback interface is a shortcut at the L3 level from the outgoing side of the IP (either IPv4 or IPv6) driver stack to the incoming side. When an application wants to communicate with another application using the network protocols, and both applications happen to be in the same host, the loopback interface allows the traffic between them to be routed more efficiently, without unnecessarily passing back & forth through the entire depth of the network protocol stack.



    Sometimes applications want to allow some traffic only within the single host, or only on a specific physical NIC: for this purpose, it is useful to have the host-internal shortcut be presented as a L3 network interface, so the higher-level protocols can just use it like any other network interface without needing to implement a special case.






    share|improve this answer















    It depends on which abstraction layer you're looking at.



    If we look at L3 of the OSI model, the IPv6 and IPv4 sides of the loopback interface are completely separate: there is no routing functionality between the two (unless you explicitly set it up). There is an optional (enabled by default, but switchable per socket) mapping of the entire IPv4 address space to a subset of the IPv6 address space, but you need to be at L4 or above to make use of it.



    On an actual physical NIC, we could also look at L2 and the physical layer, and see that both L3 protocols are actually sharing the same Ethernet media and MAC addresses, and are therefore "the same network" in L2 sense. But a loopback interface does not have a L2 layer, let alone a physical layer.



    Fundamentally, the loopback interface is a shortcut at the L3 level from the outgoing side of the IP (either IPv4 or IPv6) driver stack to the incoming side. When an application wants to communicate with another application using the network protocols, and both applications happen to be in the same host, the loopback interface allows the traffic between them to be routed more efficiently, without unnecessarily passing back & forth through the entire depth of the network protocol stack.



    Sometimes applications want to allow some traffic only within the single host, or only on a specific physical NIC: for this purpose, it is useful to have the host-internal shortcut be presented as a L3 network interface, so the higher-level protocols can just use it like any other network interface without needing to implement a special case.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Mar 22 at 17:06

























    answered Mar 22 at 15:05









    telcoMtelcoM

    20k12450




    20k12450












    • Is it really routing though? Or is it a sort of mapping in the interface between L3 and L4? I don't think I can make an IPv6 routing table entry and have it affect where the system routes IPv4 packets. Also, applications can opt out of the mapping by using the IPV6_V6ONLY socket option, and the administrator can set the system-wide default by using /proc/sys/net/ipv6/bindv6only.

      – telcoM
      Mar 22 at 17:02











    • I just wanna ask why do people analize the network strusture using OSI model. It's not used in the real world. Such answers are too unfriendly.

      – 炸鱼薯条德里克
      2 days ago

















    • Is it really routing though? Or is it a sort of mapping in the interface between L3 and L4? I don't think I can make an IPv6 routing table entry and have it affect where the system routes IPv4 packets. Also, applications can opt out of the mapping by using the IPV6_V6ONLY socket option, and the administrator can set the system-wide default by using /proc/sys/net/ipv6/bindv6only.

      – telcoM
      Mar 22 at 17:02











    • I just wanna ask why do people analize the network strusture using OSI model. It's not used in the real world. Such answers are too unfriendly.

      – 炸鱼薯条德里克
      2 days ago
















    Is it really routing though? Or is it a sort of mapping in the interface between L3 and L4? I don't think I can make an IPv6 routing table entry and have it affect where the system routes IPv4 packets. Also, applications can opt out of the mapping by using the IPV6_V6ONLY socket option, and the administrator can set the system-wide default by using /proc/sys/net/ipv6/bindv6only.

    – telcoM
    Mar 22 at 17:02





    Is it really routing though? Or is it a sort of mapping in the interface between L3 and L4? I don't think I can make an IPv6 routing table entry and have it affect where the system routes IPv4 packets. Also, applications can opt out of the mapping by using the IPV6_V6ONLY socket option, and the administrator can set the system-wide default by using /proc/sys/net/ipv6/bindv6only.

    – telcoM
    Mar 22 at 17:02













    I just wanna ask why do people analize the network strusture using OSI model. It's not used in the real world. Such answers are too unfriendly.

    – 炸鱼薯条德里克
    2 days ago





    I just wanna ask why do people analize the network strusture using OSI model. It's not used in the real world. Such answers are too unfriendly.

    – 炸鱼薯条德里克
    2 days ago













    0















    Q: Is a network defined as a set of IP addresses (...), or a set of network interfaces (...) ?




    My opinions:



    You cannot really define a network in terms of IPv6 addresses. The concept "a set of network interfaces" is more useful. See the definition of "link" below.



    This precise definition for "network" might not be widely agreed enough. So it might not be a useful term in your question.



    This differs from working with IPv4. In the IPv4 world, the term "subnet" was more common and useful.



    My reasoning:



    RFC 8200 starts with an introduction, and then definitions of 11 key terms. They do not include "network", but they do include "link".




    link: a communication facility or medium over which nodes can
    communicate at the link layer, i.e., the layer
    immediately below IPv6. Examples are Ethernets (simple
    or bridged); [...]



    interface: a node's attachment to a link.




    All interfaces share the exact same prefix for link-local unicast addresses: fe80::/10. Different hosts on different links can use the same link-local address. At a user level, you have to specify which link you want, by including an interface specifier. E.g. ping fe80::1234%lo .



    Link-local addresses can be ignored in many cases. However they are an essential part of how IPv6 works:



    When you run a standard IPv6 Local Area Network through an L2 Ethernet "switch" (or switches), the routable unicast addresses have to be resolved using Neighbour Discovery packets. ND packets are are sent using link-local addresses. [1]



    Notes



    • The ip link command is for "network device configuration". In other words, the command "ip link" is actually used to configure interfaces :-).



    • A "loopback interface" like lo is contrived by the operating system. The IPv6 standards say that ::1 may be assigned to




      a virtual interface (typically called the "loopback interface") to an imaginary link that goes nowhere.




      It does not tell you exactly how this will be implemented e.g. in Linux. I think there are some weird questions you can ask about this, but the answers do not really tell you very much.



    • You can still get away with thinking in IPv4 terms a lot of the time. But IPv6 adoption is increasing. It is good to at least try to learn IPv6 equivalents, when you are learning about specific IPv4 features. Realistically, you will probably see some terms used for IPv4, and some different terms used for IPv6. You will not always know a generic definition that can account for both IPv4 and IPv6.


    • [1] Neighbour discovery actually uses both unicast and multicast link-local addresses. E.g. ND requests are usually sent from a unicast address, to a multicast address. Link-local multicast addresses are perhaps not as simple as the unicast ones. They are the multicast addresses where the "scop" part is set to link-local.






    share|improve this answer





























      0















      Q: Is a network defined as a set of IP addresses (...), or a set of network interfaces (...) ?




      My opinions:



      You cannot really define a network in terms of IPv6 addresses. The concept "a set of network interfaces" is more useful. See the definition of "link" below.



      This precise definition for "network" might not be widely agreed enough. So it might not be a useful term in your question.



      This differs from working with IPv4. In the IPv4 world, the term "subnet" was more common and useful.



      My reasoning:



      RFC 8200 starts with an introduction, and then definitions of 11 key terms. They do not include "network", but they do include "link".




      link: a communication facility or medium over which nodes can
      communicate at the link layer, i.e., the layer
      immediately below IPv6. Examples are Ethernets (simple
      or bridged); [...]



      interface: a node's attachment to a link.




      All interfaces share the exact same prefix for link-local unicast addresses: fe80::/10. Different hosts on different links can use the same link-local address. At a user level, you have to specify which link you want, by including an interface specifier. E.g. ping fe80::1234%lo .



      Link-local addresses can be ignored in many cases. However they are an essential part of how IPv6 works:



      When you run a standard IPv6 Local Area Network through an L2 Ethernet "switch" (or switches), the routable unicast addresses have to be resolved using Neighbour Discovery packets. ND packets are are sent using link-local addresses. [1]



      Notes



      • The ip link command is for "network device configuration". In other words, the command "ip link" is actually used to configure interfaces :-).



      • A "loopback interface" like lo is contrived by the operating system. The IPv6 standards say that ::1 may be assigned to




        a virtual interface (typically called the "loopback interface") to an imaginary link that goes nowhere.




        It does not tell you exactly how this will be implemented e.g. in Linux. I think there are some weird questions you can ask about this, but the answers do not really tell you very much.



      • You can still get away with thinking in IPv4 terms a lot of the time. But IPv6 adoption is increasing. It is good to at least try to learn IPv6 equivalents, when you are learning about specific IPv4 features. Realistically, you will probably see some terms used for IPv4, and some different terms used for IPv6. You will not always know a generic definition that can account for both IPv4 and IPv6.


      • [1] Neighbour discovery actually uses both unicast and multicast link-local addresses. E.g. ND requests are usually sent from a unicast address, to a multicast address. Link-local multicast addresses are perhaps not as simple as the unicast ones. They are the multicast addresses where the "scop" part is set to link-local.






      share|improve this answer



























        0












        0








        0








        Q: Is a network defined as a set of IP addresses (...), or a set of network interfaces (...) ?




        My opinions:



        You cannot really define a network in terms of IPv6 addresses. The concept "a set of network interfaces" is more useful. See the definition of "link" below.



        This precise definition for "network" might not be widely agreed enough. So it might not be a useful term in your question.



        This differs from working with IPv4. In the IPv4 world, the term "subnet" was more common and useful.



        My reasoning:



        RFC 8200 starts with an introduction, and then definitions of 11 key terms. They do not include "network", but they do include "link".




        link: a communication facility or medium over which nodes can
        communicate at the link layer, i.e., the layer
        immediately below IPv6. Examples are Ethernets (simple
        or bridged); [...]



        interface: a node's attachment to a link.




        All interfaces share the exact same prefix for link-local unicast addresses: fe80::/10. Different hosts on different links can use the same link-local address. At a user level, you have to specify which link you want, by including an interface specifier. E.g. ping fe80::1234%lo .



        Link-local addresses can be ignored in many cases. However they are an essential part of how IPv6 works:



        When you run a standard IPv6 Local Area Network through an L2 Ethernet "switch" (or switches), the routable unicast addresses have to be resolved using Neighbour Discovery packets. ND packets are are sent using link-local addresses. [1]



        Notes



        • The ip link command is for "network device configuration". In other words, the command "ip link" is actually used to configure interfaces :-).



        • A "loopback interface" like lo is contrived by the operating system. The IPv6 standards say that ::1 may be assigned to




          a virtual interface (typically called the "loopback interface") to an imaginary link that goes nowhere.




          It does not tell you exactly how this will be implemented e.g. in Linux. I think there are some weird questions you can ask about this, but the answers do not really tell you very much.



        • You can still get away with thinking in IPv4 terms a lot of the time. But IPv6 adoption is increasing. It is good to at least try to learn IPv6 equivalents, when you are learning about specific IPv4 features. Realistically, you will probably see some terms used for IPv4, and some different terms used for IPv6. You will not always know a generic definition that can account for both IPv4 and IPv6.


        • [1] Neighbour discovery actually uses both unicast and multicast link-local addresses. E.g. ND requests are usually sent from a unicast address, to a multicast address. Link-local multicast addresses are perhaps not as simple as the unicast ones. They are the multicast addresses where the "scop" part is set to link-local.






        share|improve this answer
















        Q: Is a network defined as a set of IP addresses (...), or a set of network interfaces (...) ?




        My opinions:



        You cannot really define a network in terms of IPv6 addresses. The concept "a set of network interfaces" is more useful. See the definition of "link" below.



        This precise definition for "network" might not be widely agreed enough. So it might not be a useful term in your question.



        This differs from working with IPv4. In the IPv4 world, the term "subnet" was more common and useful.



        My reasoning:



        RFC 8200 starts with an introduction, and then definitions of 11 key terms. They do not include "network", but they do include "link".




        link: a communication facility or medium over which nodes can
        communicate at the link layer, i.e., the layer
        immediately below IPv6. Examples are Ethernets (simple
        or bridged); [...]



        interface: a node's attachment to a link.




        All interfaces share the exact same prefix for link-local unicast addresses: fe80::/10. Different hosts on different links can use the same link-local address. At a user level, you have to specify which link you want, by including an interface specifier. E.g. ping fe80::1234%lo .



        Link-local addresses can be ignored in many cases. However they are an essential part of how IPv6 works:



        When you run a standard IPv6 Local Area Network through an L2 Ethernet "switch" (or switches), the routable unicast addresses have to be resolved using Neighbour Discovery packets. ND packets are are sent using link-local addresses. [1]



        Notes



        • The ip link command is for "network device configuration". In other words, the command "ip link" is actually used to configure interfaces :-).



        • A "loopback interface" like lo is contrived by the operating system. The IPv6 standards say that ::1 may be assigned to




          a virtual interface (typically called the "loopback interface") to an imaginary link that goes nowhere.




          It does not tell you exactly how this will be implemented e.g. in Linux. I think there are some weird questions you can ask about this, but the answers do not really tell you very much.



        • You can still get away with thinking in IPv4 terms a lot of the time. But IPv6 adoption is increasing. It is good to at least try to learn IPv6 equivalents, when you are learning about specific IPv4 features. Realistically, you will probably see some terms used for IPv4, and some different terms used for IPv6. You will not always know a generic definition that can account for both IPv4 and IPv6.


        • [1] Neighbour discovery actually uses both unicast and multicast link-local addresses. E.g. ND requests are usually sent from a unicast address, to a multicast address. Link-local multicast addresses are perhaps not as simple as the unicast ones. They are the multicast addresses where the "scop" part is set to link-local.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 22 at 19:42

























        answered Mar 22 at 15:23









        sourcejedisourcejedi

        25.4k445110




        25.4k445110



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f507991%2fare-the-ipv4-and-ipv6-networks-for-my-loopback-interface-the-same-network%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            -ip, loopback, networking

            Popular posts from this blog

            Creating 100m^2 grid automatically using QGIS?Creating grid constrained within polygon in QGIS?Createing polygon layer from point data using QGIS?Creating vector grid using QGIS?Creating grid polygons from coordinates using R or PythonCreating grid from spatio temporal point data?Creating fields in attributes table using other layers using QGISCreate .shp vector grid in QGISQGIS Creating 4km point grid within polygonsCreate a vector grid over a raster layerVector Grid Creates just one grid

            What is this called? Old film camera viewer?What makes a good film camera?What to do with an old film camera?What should one look for when buying a used film camera?What is the value and age of this pre-1967 Ricoh 35 mm camera?DSLR recommendation, question about old Canon 35mm film Camera & lensesCan anyone identify the silver rangefinder-style camera in this advertisement?What kind of a Polaroid 600-camera is this?Will an old film camera still work even when not used in a very long time?What is this camera / Can I develop the film?How to fit an action camera into antique (bellows) housing?What to check when buying used and old film bodies?

            Why is this plane circling around the Lucknow airport every day?Why do aircraft on Flight Radar 24 jump around randomly sometimes?What airport has this walkway over a taxiway?How does Chicago O'Hare's tower sequence aircraft at peak capacity?Which airport is featured in this Delta commercial?After a crash, for how long is the airport closed?Can a passenger plane stand still in the air, or hover at a fixed location above a ground?What are those trucks towing around, and why?What is this airport outside of Cairo, Egypt?Which US airport has the lowest circling MDH?What is this airport video?