Data Communications

Lecture #19 - Internet Protocol: Part 1

Building Bigger Networks - Internetworking and the IP Protocol

Internetworks

An internetwork is any larger network built by interconnecting individual smaller networks. It could be tempting to use hubs or switches for this, but some aspects of their operation make this completely impractical...

Hubs

A hub operates by copying incoming bits to all other ports. Collisions are similarly broadcast - in other words we have a single collision domain. If a hub is used to extend a network, the physical constraints imposed by CSMA/CD still apply since any station on the network can collide with any other.

Layers Implemented by a Hub
  • CSMA/CD would have to work over the entire network, limiting its size to about 2.5km end to end (at 10 mbps, shorter for faster speeds).
  • Collisions would overwhelm the network.
  • Hubs have become obsolete anyway because of the rapidly falling cost of networking hardware.

Switches

Switches selectively copies frames based on their MAC ("Ethernet") address. Collisions cannot traverse a switch, so the entire network is separated into two or more collision domains. The frame is not changed in any way in passing through the switch.

Layers Implemented by a Switch

While it is possible to construct a large network using switches and Media Access Control (MAC) style data "packets", there are some "second order" problems that will eventually make it impractical.

  • Ethernet MAC addresses are likely to be randomly distributed. The resulting network will be "one large sea of machines" ie. there will be no address hierarchy.
  • Because of the lack of hierarchy, every switch would need to know where every machine on the network was. An onerous task!
  • And then there is the problem of "broadcasts". Do they get delivered to the entire internet??

The Internet Protocol

The Grand Plan™ for the Internet is that ALL traffic is carried in Internet Protocol (IP) packets.

These IP packets in turn are carried by "lower level" protocols such as Ethernet.

The IP packets usually carry higher level protocol data. TCP and UDP (which we meet later) are the most common.

The Internet Protocol implements an addressing scheme that exploits the "interconnected network" idea and is somewhat easier to route.

Formally, the structure of the Internet "protocol stack" is:

Internet Model/Protocol Stack

Application Layer

Applications that operate in a TCP/IP internetwork

Transport Layer

Provides an end-to-end interprocess communications service. Both connection-oriented (TCP) and connectionless (UDP) models of communication are supported.

Network Layer
(Internet Layer)

Provides packet ("datagram") delivery both within and between local networks, usually LANs, using the Internet Protocol, IP.

Data Link Layer
(Network Interface Layer/MAC Layer)

Point of interconnection to the LAN, defined by (for example) the Ethernet MAC specification.

Physical Layer

Physical media that provides connectivity between devices.

Structure of The Internet

The Internet is a global IP internetwork - any Internet connected host can (in principle) send IP packets to any other.

A hardware device which interconnects two networks is formally called an IP Gateway, or more commonly a router. A router has two (or more) IP addresses - one for each of the networks to which it is connected.

Layers implemented by a Router

IP datagrams navigate zero or more (sometimes many) routers, interconnecting the individual networks which together make up the Internet:

Structure of the Internet

When a datagram finally arrives at a router which is connected to its destination network, it is delivered to the destination hosting. ARP (see later) to resolve the destination host address to a MAC-layer address on the local network.

IP Addresses

The IP protocol provides the basic host-to-host delivery service for TCP/IP. Fundamental to this is the concept of a global Internet addressing scheme.

every computer has a unique Internet host address. For Internet Protocol Version 4 (IPv4) this is a 32 bit (4 byte) binary number.

Internet addresses are written (for human consumption) as a dotted sequence of the form:

    aa.bb.cc.dd

where aa, bb, etc, are the decimal values (ranging from 0 to 255) of the 4 bytes which make up the internet address, for example:

    149.144.20.200

This is called the "Common Internet Address Notation". The 32 bit Internet address consists of two parts, the network part and the host part. The network part must be the same for all hosts connected to the same network. In this context, a network is usually equivalent to a single Ethernet LAN.

The host part must be a number unique to that specific network.

IP Address Classes (pre 1992)

The structure of an IP address differs depending on the class of the local network to which the host is connected:

Class A Network
The leftmost field (or byte) of the address specifies the network number and class, and can take values from 1 to 126.
127 is reserved for "local loopback" addresses.
Class B network
The leftmost two fields (bytes) specify network the number and class. The first field is in the range from 128 to 191.
Class C network
The leftmost three fields specify network number and class. The first field can be from 192 to 223.

The internet address format can be described graphically thus:

IP Broadcast Address

The broadcast address is the address used to send data to all hosts on the local network simultaneously. This is the address given by the network number followed by all binary 1's in the host part of the address (known as a directed broadcast address).

For example: The broadcast address for a host on the La Trobe, Bendigo Class-B IP network would be[1]:

    149.144.255.255

An example class C broadcast address is:

    197.23.114.255

An interesting observation on the nature of networks vs. internetworks in the context of IP is that the addressing model defines a network to be a group of hosts which share a common network part in their IP address.

Thus, the distinction between a network and an internetwork rests entirely on the IP addressing model.

All hosts on the current network can also be addressed using an IP address that consists of all 1's - that is 255.255.255.255 in dotted decimal form. This is known as a limited broadcast address, since it is not routable.

[1] Except for the fact that subnetting is in use, see next slide

IP Subnet Addressing

The host part of the address is now commonly split, for management purposes, to allow subnet addressing (or subnetting) - eg. typically this involves (for a Class B network) defining 254 subnets each of 254 hosts. Each of these subnets behaves, for all intents, like an independent class-C network: thus:

Exactly which bits of the subnetted address are used for the network/subnet part and the host part is defined using an address mask, or netmask, typically:

    255.255.255.0

For example, at Bendigo the "ironbark" UNIX system address is:

    149.144.20.200

Thus ironbark is addressed as:

Class B network
149.144
Subnet
21
Host number
60

CIDR Addressing (post 1992)

In the late 1980's it became obvious that the Class A, B & C allocation of addresses was rapidly using up the 4 billion available addresses (in a generally wasteful manner). In particular, the class A and B networks were too generous for many organisations.

One approach to eliminating the amount of wasted address space is that of Classless Inter-Domain Routing (CIDR), which is based on the idea of Variable Length Subnet Masks (VLSM). In the VLSM scheme, the host part of the address is made long enough to get the required number of hosts in the network (2N - 2 hosts where N is the number of bits in the host part of the address.)

This produces networks of 2, 6, 14, 30, 62, 126, 254, 510, 1022 etc. hosts. ie.2(32-nn) - 2

These are more useful network sizes than 16777214 hosts, offered by Class A and 65534 hosts, offered by Class B networks. These CIDR/VLSM addresses are still 32 bits long and are allocated form those Class A, B and C addresses which haven't yet been allocated.

These addresses are written, for example as 149.144.20.0/24. This means the network part of the address is the most significant 24 bits, with the rest being the host number.

Address Resolution

The Internet Address Resolution Protocol (ARP) is used to map IP addresses to MAC-layer addresses. It operates as follows:

  • A special type of MAC-layer frame, the ARP frame, is defined for address resolution use. For DIX Ethernet V.2, the two-byte type field is 0x0806. For 802.3 SNAP it has a Protocol/OrgID of 0x000000 and a type of 0x0806.
  • A host (call it "A") wishing to discover the MAC-layer address of another host (call it "B") transmits a ARP Request to the MAC-layer broadcast address - for Ethernet this is the address of all 1's (ff:ff:ff:ff:ff:ff).
  • The ARP Request broadcast frame contains the IP address of the desired host, "B".
  • All hosts connected to the MAC-layer network examine the ARP query. If a host finds that its own address matches that in the query, (ie. it is host "B") it sends an ARP Response frame back to the original host "A".
  • "A" and "B" now know each other's IP addresses, and can communicate using the MAC-layer network.

On most operating systems, the arp -a command allows ordinary users to examine the system "ARP Table". This contains cached ARP queries and any static IP to MAC mappings (static ARP entries).

RARP Servers

Most host computers ought to know their IP address, some don't. Some diskless workstations need to discover their IP number at boot-up.

RARP, the Reverse Address Resolution Protocol provides a server to answer queries of the form "What is the IP number of the machine with MAC address 01:02:03:04:05:06?".

References

Stallings: Chapter 18.4 (pp. 576-586)

RFC791 - Internet Protocol