Internetworking

Networks

A network is a group of devices that can communicate with each other.

Networks consist of hosts, each of which has a unique address and the various network equipment needed to establish interconnections among the hosts. The hosts make use of network-specific host addresses in order to transmit messages to each other. Depending upon whether the network is circuit switched or packet switched, these messages are either in the form of data streams or datagrams.

Circuit Switched

In a circuit switched network, a host uses some means to signal that it wishes to communicate with another host. This causes a dedicated connection to be established between the two hosts over which a continuous sequence of data may be written. Since there is no real starting or stopping within this sequence of data (other than those delays that are added by the sender), this virtually continuous flow of data is called a stream.

Each byte that the sender transmits arrives at the recipient in the same order it was transmitted. Furthermore, since the connection is dedicated to just the communication between those two hosts, one side or the other generally knows with certainty if the connection has been lost. A feature (sometimes painfully) absent in the more flexible but unreliable packet-switched environment.

Packet Switched

First conceived of in a landmark paper by Leonard Kleinrock of MIT (Information Flow in Large Communication Nets, 1961), a packet switched network differs significantly from a circuit switched network. When one host wishes to communicate with another in a packet switched network, it constructs a datagram with the information it wishes to transmit along with appropriate addressing information. It then delivers this datagram to the network for receipt by the destination host.

Since there is no dedicated connection between the two hosts, there is generally no way for a sender to be sure that the receiver actually saw the message that was sent to it. Unless, of course, the recipient sent some sort of confirmation that the message was received. However, this confirmation message suffers from the same possibility of getting lost as the original message. This is how we arrive at the two generals problem.

Topology

There are many ways to connect hosts together when it comes to the physical cabling. Some of the more popular methods are the bus, ring and star configurations.

Bus

In the bus configuration, all the hosts are connected to a common link of some sort where each host is an equivalent peer of each other. The Bus network is named because it is similar to an electronics bus and so we get the name from Electrical Engineering.

Star

In the star configuration, every host connects to a central node of some sort (which may be a host itself) and every connection to every other host is routed through that central node. It is called this because the diagram for this kind of network looks somewhat like a star.

Ring

The ring topology has each host connected to a left and a right neighbor until eventually the last host is connected to the first, thus forming a ring. This topology is popular when the physical medium being used is not capable of being shared, e.g. fiber optic.

Others

You can read about several other topologies at the Wikipedia page on network topology.

Datagrams

A datagram consists of some quantity of data along with all the information needed to deliver that data from the sender to the recipient. Since all the information necessary to take the given data through the network and to its destination, a datagram can be considered an autonomous entity.

An idealized datagram

To:that host over there
From:this host right here
Message:Four score and ...

Addressing a datagram does require that a unique name exist for every participant in the network. One can make the case that a continuous series of reliably delivered datagrams is indistinguishable from a stream and therefore one can often get the benefits of a packet switched network with the usefulness of a stream for communicating data. Doing so requires that some sort of virtual stream or circuit be established between the two hosts. This is exactly what a protocol like TCP/IP does.

Internets

An internet is a connected set of networks that is designed to operate as one big virtual network. Connections are created by designating certain hosts as routers and giving them connections to both networks. This enables that host to pass messages between the two networks based upon which hosts are on which networks. This is referred to as routing. If you combine routing with globally unique host addresses, you can create an effective illusion that there is only one big virtual network which all hosts reside upon. The only visible difference to end users (if any) will be the differences in performance when communicating with various hosts. The advantages of a single virtual network running on top of many real networks are many fold.

Heterogeneity

Since the protocol that is used in an internet is generally specifically designed to hide the particulars of the physical networks underneath it, an internet can be constructed out of a variety of different technologies. Each of which has its own particular benefits and drawbacks.

Performance

Even in an environment that is constructed entirely of one networking technology (e.g. ethernet), internetworking can reduce the amount of traffic on busy links. If you have 500 people in a building, all sharing the same physical network, they would have to share the bandwidth. Instead by creating mutliple internetworked segments you segregate the traffic so that nobody has to see all the traffic at once. A process called segmenting. If you are on a broadcast-oriented network (e.g. ethernet) then segmenting is a requirement for networks with hundreds or thousands of hosts.

Security

Because you are physically separating networks via routers, you can use the routers to enforce policies regarding what data is and is not passed between the two networks. This gives tremendous power to secure the communications between hosts and access to hosts. Familiar forms of this are Firewalls which are policy based routers and content filtering proxies.

Scale

Because you can use heterogenous network technologies in an internetwork, you can construct your network to best fit your environment. Ethernet based lans for users in the same building or floor, fiber optic backbones to channel traffic to centralized or distributed servers which are connected to distant networks via long-distance links provided by a telco.

Drawbacks

All of these advantages do come at a cost, even if it is a slight one. The first of which is complexity. When you combine multiple networks together, then add a new protocol layered on top of them to hide the real network, you are inherently increasing the complexity, overhead and maintenance cost of the internetwork.

In talking about computer networks, the net cost increase is usually minor when the advantages above are taken into consideration. It is even possible, if not common, that internetworking technologies provide benefits that far exceed the costs of increased complexity. This is especially true at the enterprise level where improved communication efficiency nearly always produces a benefit.

The Internet

The biggest internetwork of them all is the Internet, powered by IPv4. That's Internet with a capital 'I'. This is the internet that is so big you almost can't miss it. While the technologies defined by the IETF, W3C and all those other standards bodies could be deployed in entirely private internetworks, it is most often true that even these deployments are gatewayed in some fashion to the global internetwork called The Internet.

IP Addressses

The Internetwork Protocol, or IP is the protocol that the modern Internet is built on. Specifically IPv4 as defined in RFC 791. In this network model, every host is assigned a unique 32-bit host address by a central authority. This central authority serves to ensure that no two hosts are given the same address. Though in reality, for practical purposes, the central authority assigns blocks of addresses (network blocks) to organizations who then ensure that those addresses within their block are not assigned more than once.

These globally unique host addresses are the first of two steps needed to construct a single, world-wide virtual network. The second is routing, but that is discussed elsewhere. At the local level, a single network generally has assigned to it a range of addresses and a host within that network is assigned one of them. Internet addresses consist of a 32-bit number and when using them on a network there is also a bitmask which determines what parts of the host address describe the network, and which ones describe the host.

In general, all the hosts that share the same network mask and network address reside on the same network. Because binary is so cumbersome and due to a historical fact that netmasks used to only be 8,16 or 24, IP addresses are typically written as a dotted-quad where the full address is broken into four octets and written in decimal form with dots between the octets. The network mask is then appended with a slash thereby uniquely describing the host and the network it is on. As you can see in the table, for the netmasks 8 and 24, the network and host address boundary is right on the dot in the dotted quad.

Examples of internet addresses

32 bit addressdotted quad/netmasknetwork addresshost address
0000101001011010011000111000111010.90.99.142/00.0.0.010.90.99.142
0000101000101011100111010101110010.43.157.92/30.0.0.010.43.157.92
0000101010101111000101010001110110.175.21.29/58.0.0.02.175.21.29
0000101011001100000111100011001110.204.30.51/810.0.0.00.204.30.51
0000101001011011110100010001101010.91.209.26/1210.80.0.00.11.209.26
0000101010110111011010100101100010.183.106.88/1310.176.0.00.7.106.88
0000101000010011111001110111001110.19.231.115/1410.16.0.00.3.231.115
0000101001011010010011000000111010.90.76.14/1510.90.0.00.0.76.14
0000101011110001011000101001110010.241.98.156/1810.241.64.00.0.34.156
0000101001011110000110011010100010.94.25.168/1910.94.0.00.0.25.168
0000101011000000011010001010110110.192.104.173/2010.192.96.00.0.8.173
0000101000100000001110000010101110.32.56.43/2310.32.56.00.0.0.43
0000101011110110111111100011110110.246.254.61/2410.246.254.00.0.0.61
0000101010011110011101101100010110.158.118.197/2510.158.118.1280.0.0.69
0000101010000010000101100010001010.130.22.34/2610.130.22.00.0.0.34
0000101001100000100100111100001110.96.147.195/2810.96.147.1920.0.0.3
0000101010010010111111000100011010.146.252.70/2910.146.252.640.0.0.6

Using these 32 bit addresses, IP creates datagrams containing up to around 65KB of data, along with the source, destination and a couple extra fields in order to communicate between any two hosts, anywhere on the internetwork.

UDP/IP

The User Datagram Protocol is a means for programs to make use of the IP network with very little additional complexity. It addresses the issue of multiplexing by using port numbers at the source and destination. Because IP only provides packets addressed to specific hosts, there is no way using pure IP to tell a host which program running on it is intended to receive a particular datagram. Therefore the concept of ports is used to sort incoming packets.

A program on a host which wishes to receive data on a particular port notifies the host's operating system which port it is interested in. So long as no other running program has registered interest in that port, any incoming packets to that port are routed to that program on the host for processing.

Port numbers are a 16 bit number in the range 0-65535. The IANA maintians a list of registered and well-known ports to aid in the smooth operation of the Internet. Since UDP is essentially IP with port numbers, UDP has no guarantees of delivery or non duplication. This means it is possible for a UDP packet to be silently dropped somewhere in the network, or it could be delivered any number of times. Therefore it is up to the program which uses UDP to ensure that it properly handles missing and duplicated UDP datagrams.

TCP/IP

Similar to UDP, TCP is also built on top of IP. The Transmission Control Protocol provides a virtual stream oriented connection between two hosts. This means that the bytes arrive in-order, or not at all when transmitted and an essentially unlimited amount of data may be transferred. TCP packets are multiplexed and demultiplexed in a similar fashion to UDP packets. That is to say TCP packets use ports as well.

TCP sessions differ significantly from UDP sessions in that there is a far more complicated (and time consuming) setup and teardown process to establishing and breaking these connections. This is required in order to implement reliable, ordered transport over the unreliable mechanism of IP. Regardless, for many if not most applications, reliability outweighs performance, at least on the scale of UDP vs. TCP performance.

It is important to note that while there is a client/server relationship during the setup of the TCP session, once established either of the originating roles may become irrelevant. Both sides may transmit and receive simultaneously. Therefore a TCP session is effectively two opposing virtual streams operating over the unreliable internet.

Valid XHTML 1.0!