What IP address is used as a loopback address and is not valid IP address that can be assigned to a network?

50.50.50.50 is only a valid IPAddress in that it is syntactically correct and can be parsed without throwing an exception. To start a TcpListener on that IP, the IP must be valid and "pingable" on one of your network interfaces. Most likely, the IP you are trying isn't in one of your HostEntries.

To get a list of valid local host entries, you can enumerate the list returned from System.Net.Dns.GetHostName method:

internal static IEnumerable<IPAddress> GetLocalHostIPs() {
  foreach (var ip in Dns.GetHostEntry(Dns.GetHostName()).AddressList)
    yield return ip;
}

As Brits pointed out, using IPAddress.Any is, in most use cases, what you should use. If you are wanting to only listen on a specific NIC, you should first check that your desired IP is in the HostEntry's address list. One possible way of doing that, without throwing, could be by using a utility function similar to the following:

using System.Net;

/// <summary>
/// Parses an IP string, and verifies that it is in the HostEntry's AddressList.
/// </summary>
/// <param name="localIPString">The string to parse and verify</param>
/// <returns><paramref name="localIPString"/>, if it is a valid local IP and found in the HostName's AddressList; otherwise, <see cref="IPAddress.Any"/></returns>
public static IPAddress TryLocalIPOrAny(string localIPString)
{
    if (localIPString != null && IPAddress.TryParse(localIPString, out IPAddress address))
    {
        if (Dns.GetHostEntry(Dns.GetHostName()).AddressList.Contains(address))
        {
            return address;
        }
    }

    return IPAddress.Any;
}

Then just wrap your IP with that function call when using it to start your listener:

var slaveTcpListener = new TcpListener(TryLocalIPOrAny("50.50.50.50"), 0);
//...

What IP address is used as a loopback address and is not valid IP address that can be assigned to a network?

Next: Address Resolution Up: Issues of TCP/IP Networking Previous: Networking Interfaces
As mentioned in the previous chapter, the addresses understood by the IP-networking protocol are 32-bit numbers. Every machine must be assigned a number unique to the networking environment. If you are running a local network that does not have TCP/IP traffic with other networks, you may assign these numbers according to your personal preferences. However, for sites on the Internet, numbers are assigned by a central authority, the Network Information Center, or NIC.
What IP address is used as a loopback address and is not valid IP address that can be assigned to a network?

For easier reading, IP addresses are split up into four 8-bit numbers called octets. For example, quark.physics.groucho.edu has an IP-address of 0x954C0C04, which is written as 149.76.12.4. This format is often referred to as the dotted quad notation.

Another reason for this notation is that IP-addresses are split into a network number, which is contained in the leading octets, and a host number, which is the remainder. When applying to the NIC for IP-addresses, you are not assigned an address for each single host you plan to use. Instead, you are given a network number, and are allowed to assign all valid IP-addresses within this range to hosts on your network according to your preferences.

Depending on the size of the network, the host part may need to be smaller or larger. To accommodate different needs, there are several classes of networks, defining different splits of IP-addresses.

        Class A Class A comprises networks  1.0.0.0  through  127.0.0.0.   The
                network number is contained in the first octet.  This provides
                for a 24 bit host part, allowing roughly 1.6 million hosts.


        Class B Class B contains networks 128.0.0.0 through  191.255.0.0;  the
                network  number  is  in the first two octets.  This allows for
                16320 nets with 65024 hosts each.


        Class C Class C networks range from 192.0.0.0  through  223.255.255.0,
                with  the  network  number  being contained in the first three
                octets. This allows for nearly 2 million networks with  up  to
                254 hosts.


      Classes D, E, and F Addresses   falling  into  the  range  of  224.0.0.0
                through 254.0.0.0 are either experimental, or are reserved for
                future use and don't specify any network.



If we go back to the example in the previous chapter, we find that 149.76.12.4, the address of quark, refers to host 12.4 on the class-B network 149.76.0.0.

You may have noticed that in the above list not all possible values were allowed for each octet in the host part. This is because host numbers with octets all 0 or all 255 are reserved for special purposes. An address where all host part bits are zero refers to the network, and one where all bits of the host part are 1 is called a broadcast address. This refers to all hosts on the specified network simultaneously. Thus, 149.76.255.255 is not a valid host address, but refers to all hosts on network 149.76.0.0.

There are also two network addresses that are reserved, 0.0.0.0 and 127.0.0.0. The first is called the default route, the latter the loopback address. The default route has something to do with the way IP routes datagrams, which will be dealt with below.

Network 127.0.0.0 is reserved for IP traffic local to your host. Usually, address 127.0.0.1 will be assigned to a special interface on your host, the so-called loopback interface, which acts like a closed circuit. Any IP packet handed to it from TCP or UDP will be returned to them as if it had just arrived from some network. This allows you to develop and test networking software without ever using a ``real'' network. Another useful application is when you want to use networking software on a standalone host. This may not be as uncommon as it sounds; for instance, many UUCP sites don't have IP connectivity at all, but still want to run the INN news system nevertheless. For proper operation on , INN requires the loopback interface.


What IP address is used as a loopback address and is not valid IP address that can be assigned to a network?

Next: Address Resolution Up: Issues of TCP/IP Networking Previous: Networking Interfaces Andrew Anderson
Thu Mar 7 23:22:06 EST 1996

What IP address is used as a loopback address and is not a valid IP address that can be assigned to a network?

0.1 IP Address: The IP address 127.0. 0.1, also called loopback, is exclusively for localhost use.

What is the 127.0 0.0 network used for?

Network 127.0. 0.0 is reserved for IP traffic local to your host. Usually, address 127.0. 0.1 will be assigned to a special interface on your host, the loopback interface, which acts like a closed circuit.

Which of the following IP addresses would be a loopback IP address?

The IP address 127.0. 0.1 is called a loopback address.

Which address represent valid local loopback addresses?

Typically 127.0. 0.1 is used as the local loopback address.