Network addressing

From Linux 101, The beginner's guide to all things Linux.

Jump to: navigation, search

There are many forms of network addressing. We'll only cover the common ones in this article.

Contents

[edit] MAC Addresses

In computer networking a Media Access Control address or MAC address is an identifier physically stored inside a network card or similar network interface and used to assign globally unique addresses in some OSI model Layer 2 networks, and in the physical layer of the Internet protocol suite. MAC addresses are assigned by the IEEE, and are used in many widely used network technologies, including (but not limiting to) the following:

  • Ethernet
  • Token ring
  • IEEE 802.11 wireless networks
  • FDDI

Since the original designers of Ethernet had the foresight to use a 48 bit address space, there are potentially 248 or 281,474,976,710,656 possible MAC addresses. Ethernet MAC addresses are typically given as a string of 12 hexadecimal digits. The first six of these identify the manufacturer of the card and are known as the Organisational Unique Identifier (OUI), the last six are assigned by the manufacturer and are known as the burned-in addresses (BIA) or sometimes as the Universally Administered Addresses (UAA). The IEEE assigns the 24-bit OUI prefixes to organizations, effectively allocating blocks of 224 (16,777,216) MAC addresses at a time. The BIA can be overridden with a Locally Administered Address (LAA).

The IEEE has built in several special address types to allow more than one NIC to be addressed at one time:

  • Broadcast address or FFFF.FFFF.FFFF (hexadecimal). This tells all NICs within the confines of a local area network (LAN) to process a frame with this MAC address.
  • Multicast address, used with both Ethernet and FDDI. This a group of addresses in the 0x0100.5Enn.nnnn range (where n is any hexadecimal number) that allows a subset of NICs in a LAN to be addressed. A NIC will only accept a frame with a multicast MAC address if it is configured to do so.
  • Functional address identify one of more Token Ring NICs that provide a particular service, defined by the IEEE in their standard ISO/IEC 8820-5.

[edit] Changing MAC addresses

Although physical MAC addresses are permanent by design, several mechanisms allow modification, or "spoofing", of the MAC address that is reported by the operating system. This can be useful for privacy reasons, for instance when connecting to a Wi-Fi hotspot, or to ensure interoperability. Some ISPs bind their service to a specific MAC address; if the user then changes their network card or intends to install a router, the service won't work anymore. Changing the MAC address of the new interface will solve the problem. Similarly, some software licenses are bound to a specific MAC address. Changing the MAC address in this way is not permanent: after a reboot, it will revert to the MAC address physically stored in the card.

Under Linux, the MAC address of a Network Interface Card (NIC) can be changed using a command such as

ifconfig eth0 hw ether 00:01:02:03:04:05

(This needs to be done before network initialization.)


[edit] IP Addressess

[edit] Simple Explanation

An IP Address is a unique number, akin to a telephone number, used by machines (usually computers) to refer to each other when sending information through the Internet. This allows machines passing the information onwards on behalf of the sender to know where to send it next.

Converting to these numbers from the more human-readable form of Domain addresses, such as www.example.com, is done via the Domain Name System. The process of conversion is known as resolution of Domain names.

[edit] More Detail

The Internet Protocol (IP) knows each logical host interface by a number, the so-called IP address. On any given network, this number must be unique among all the host interfaces that communicate through this network. Users of the Internet usually use a domain name in addition to their numerical IP address.

The IP address of users browsing the world wide web are used to enable communications with to the server of the web site. Also it is usually in the header of email messages one sends. Depending on one's Internet connection the IP address can be the same every time one connects, a static IP address, or different per session (but the first part being the same each time): a dynamic IP address.

Internet addresses are needed not only for unique enumeration of host interfaces, but also for routing purposes, therefore a high fraction of them are always unused or reserved. As there are only a limited number of 32-bit IP addresses currently available to be allocated, with rising demand for new devices, including personal communicators for up to 6 billion people world-wide, there is a real prospect of the world running out of IP addresses.

A number of measures have been taken to conserve the existing IPv4 address space (such as CIDR and the use of NAT and DHCP), but there is a general consensus that the Internet is going to have to upgrade its addressing scheme to the longer 128-bit IPv6 addressing scheme sometime in the next 5 to 15 years.

[edit] IP version 4

In IPv4, the current standard protocol for the Internet, IP addresses consist of 32 bits, which makes for 4,294,967,296 (over 4 US billion) unique host interface addresses in theory. In practice the address space is sparsely populated due to routing issues, so that there is some pressure to extend the address range via IP version 6 (see below).

IPv4 addresses are commonly expressed as a dotted quad, four octets (8 bits) separated by periods. The host known as www.wikipedia.org currently has the number 3482223596, written as 207.142.131.236. (Resolving the name "www.wikipedia.org" to its associated number is handled by DNS.)

A range of consecutive IP addresses (also called a netblock or subnet) can be specified in various ways. An older method uses a network number (a dotted quad, e.g. 130.94.122.199) together with a netmask (another dotted quad, for example 255.255.255.240) which in binary notation consists of a series of 1's followed by a series of 0's. Here the netblock is comprised of all the addresses, that, when binary ANDed with the netmask, result in the network number; 64.78.205.192 through 64.78.205.207 in our example.

A shorter form, which is known as CIDR notation, gives the network number followed by a slash and the number of 'one' bits in the binary notation of the netmask (i.e. the number of relevant bits in the network number). Using this notation, the netblock above could be referred to as 130.94.122.199/28 or as the 130.94.122.192/28 prefix.

The actual assignment of an address is not arbitrary. An organization, typically an Internet service provider, requests an assignment of a netblock from a registry such as ARIN (American Registry for Internet Numbers). The network number comprises a range of addresses which the organization is free to allocate as they wish. An organization that has exhausted a significant part of its allocated address space, can request another netblock.

For example, ARIN has allocated the addresses 64.78.200.0 through 64.78.207.255 to Verado, Inc. In turn, Verado has allocated the addresses 64.78.205.0 through 64.78.205.15 to Bomis. Bomis, in turn, has assigned the specific address 64.78.205.6 to the host interface that is named www.wikipedia.com.

Some private IP address space has been allocated via RFC 1918. This means the addresses are available for any use by anyone and therefore the same RFC 1918 IP addresses can be reused. However they are not routeable on the Internet. They are used extensively due to the shortage of registerable addresses and therefore NAT is required to connect those networks to the Internet.

[edit] IP version 5

What would be considered as IPv5 existed only as an experimental non-IP real time streaming protocol called ST2 described in RFC 1819. This protocol was abandoned in favour of RSVP.

[edit] IP version 6

In IPv6, the new (but not yet widely deployed) standard protocol for the Internet, addresses are 128 bits wide, which, even with generous assignment of netblocks, should suffice for the foreseeable future. In theory, there would be 18,445,618,199,572,250,625 (or about 1.845*10^19) unique host interface addresses. This large address space will be sparsely populated, which makes it possible to again encode more routing information into the addresses themselves.

A version 6 address is written as eight 4-digit hexadecimal (16-bit) numbers separated by colons. One string of zeros per address may be left out, so that 1080::800:0:417A is the same as 1080:0:0:0:0:800:0:417A

Global unicast IPv6 addresses are constructed as two parts: a 64-bit routing part followed by a 64-bit host identifier.

Netblocks are specified as in the modern alternative for IPv4: network number, followed by a slash, and the number of relevant bits of the network number (in decimal). Example: 12AB::CD30:0:0:0:0/60 includes all addresses starting with 12AB00000000CD3.

IPv6 has many other improvements over IPv4 than just bigger address space, including autorenumbering and mandatory use of IPSec.

Further reading: RFC 791, RFC 1519 (IPv4 addresses), and RFC 2373 (IPv6 addresses).

[edit] External links

Personal tools