Sunday, November 18, 2007

OSI and TCP/IP


The principles that were applied to arrive at the seven layers are as follows:

  1. A layer should be created where a different level of abstraction is needed.
  2. Each layer should perform a well defined function.
  3. The function of each layer should be chosen with an eye toward defining internationally standardized protocols.
  4. The layer boundaries should be chosen to minimize the information flow across the interfaces.
  5. The number of layers should be large enough that distinct functions need not be thrown together in the same layer out of necessity, and small enough that the architecture does not become unwieldy.

Note: the OSI model itself is not a network architecture because it does not specify the exact services and protocols to be used in each layer. It just tells what each layer should do.

The physical layer

The physical layer is concerned with transmitting raw bits over a communication channel.

The major goal: making sure that when one side sends a 1 bit, it is received by the other side as a 1 bit, not as a 0 bit.

Typical questions (main design issues):

  • How many volts should be used to represent a 1 and how many for a 0.
  • How many microseconds a bit lasts.
  • Whether transmission may proceed simultaneously in both directions.
  • How the initial connection is established and how it is torn down when both sides are finished.
  • How many pins the network connector has and what each pin is used for.
These issues belong to the domain of the electrical engineer.

The data link layer

It takes a raw transmission facility from the physical layer and transforms it into a line that appears free of undetected transmission errors to the network layer.

Main design issues:

  • Break the input data up into data frames and transmit the frames sequentially.
  • Process the acknowledgement frames sent back by the receiver.
  • Retransmit lost or damaged frames, and solve the problem of possible duplicate frames.
  • Offer several different service classes to the network layer, each of a different quality and price.
  • Use some traffic regulation mechanism to let the transmitter know how much buffer space the receiver has at the moment. This flow regulation is frequently integrated with error handling.
  • A Medium ACcess (MAC) sublayer is introduced to deal with the access control over the shared channel in broadcast networks.

The network layer

The main task of this layer is to control the operation of the subnet.

  • Routing from source to destination: static, dynamic (per session or per packet). Congestion control.
  • Allowing heterogeneous networks to be interconnected (internetworking): different addressing, length of packet, and protocols.
  • Accounting: count the number of packets or character per customer.

In broadcast networks, the routing problem is simple, so the network layer is often thin or even nonexistent.

The transport layer

The basic function of this layer is to

  • accept data from the session layer,
  • split it up into smaller units if need be,
  • pass these to the network layer, and
  • ensure that the pieces all arrive correctly at the other side.
All these must be done efficiently.

Connection management

  • Each transport connection corresponds to one network connection (in normal conditions).
  • Each transport connection corresponds to multiple network connections (for a high throughput).
  • Multiple transport connections correspond to one network connection (for convenience and low cost).

  • A distinction must be made among multiple connections entering and leaving each host (using transport header ).
  • A naming mechanism is needed so that a process on one host has a way of describing with whom it wishes to converse (establishing a connection).

Type of services

  • An error-free point-to-point channel that delivers messages in the order in which they were sent.
  • Isolated messages with no guarantee about the order of delivery.
  • Broadcasting of messages to multiple destinations.
The type of service is determined when the connection is established.

The transport layer is a true source-to-destination or end-to-end layer. Flow control between hosts is also needed but different from between routers (similar principles will apply to both).

The session layer

This layer provides enhanced services useful in some applications, e.g., remote login, remote file transfer.

The presentation layer

Unlike all the lower layers, which are interested in transmitting messages over the network, this layer is concerned with the syntax and semantics of the information transmitted.

Typical services:

  • Encode data in a standard agreed upon way to facilitate information exchange among heterogeneous systems using different codes for strings (e.g., ASCII and Unicode), integers (e.g., one's complement and two's complement), and so on.
  • Data compression for reducing the number of bits to be transmitted.
  • Cryptography for privacy and authentication.

The application layer

This layer contains a variety of commonly needed protocols.

Typical services:

  • Transfer files among different file systems.
  • Electronic mails among different systems.
  • Remote job entry, directory lookup, and various other general-purpose and special-purpose facilities.

The TCP/IP reference model

The TCP/IP model was used in the grandparent of all computer networks, the ARPANET, and its successor, the worldwide Internet.

Major design goals:

  • The ability to connect multiple networks together in a seamless way.
  • The ability to survive loss of subnet hardware, with conversations not being broken off.
  • A flexible architecture for supporting applications with divergent requirements, ranging from transferring files to real-time speech transmission.

All these goals led to the choices of a packet-switching network based on a connectionless internetwork layer, called the internet layer.

The internet layer

The official packet format and protocol at this layer is called IP (Internet Protocol).

Its job is to inject IP packets into any network and have them travel independently to the destination (potentially on a different network).

The TCP/IP internet layer is very similar in functionality to the OSI network layer, as shown in Figure



The transport layer

It is the same in functionality as the OSI transport layer.

Two official end-to-end protocols:

  • TCP (Transmission Control Protocol): a reliable connection-oriented protocol.
  • UDP (User Datagram Protocol): an unreliable connectionless protocol.

The relation of IP, TCP, and UDP is shown in above Figure



The application layer

The TCP/IP model does not have session or presentation layers, which are of little use to most applications.

The top application layer contains all the higher-level protocols, as shown in Figure .Many other protocols, such as HTTP used on the World Wide Web, have been added over the years.

The host-to-network layer

The layer below the internet layer is a great void. The TCP/IP model just points out that the host has to connect to the network using some protocol so it can send IP packets over it. This protocol is not defined and varies from host and network to network.

A comparison of the OSI and TCP/IP reference models

Fundamental similarities:

  • The same concept of a stack of independent protocols.
  • Similar functionality of the layers.

The three central concepts to the OSI model:

  1. Services: which tell what the layer does, not how entities above it access it or how the layer works.
  2. Interfaces: which tell the processes above it how to access it (i.e., what the parameters and results are), not how the layer works inside.
  3. Protocols: which are used between peer entities to implement the offered services.

The biggest contribution of the OSI model is to make the distinction between these three concepts explicit. The TCP/IP model did not clearly distinguish them.

Other major differences:

  • The OSI model was devised before the protocols were invented, but the reserve was true with the TCP/IP model.
  • The OSI model has seven layers, but the TCP/IP model has only five layers.
  • The OSI model supports both connection-oriented and connectionless communication in the network layer, but only connection-oriented communication in the transport layer.

    The TCP/IP model has only connectionless mode in the internet layer, but has both modes in the transport layer.

A critique of the OSI model and protocols

Summary:

  • Bad timing.
  • Bad technology.
  • Bad implementation.
  • Bad politics.
Read the text for (very instructive) details.

A critique of the TCP/IP reference model

  • No clear distinguishment of the concepts of service, interface, and protocol not much of a guide for designing new networks using new technologies.
  • Not general and poorly suited to describing any protocol stack other than TCP/IP, e.g., SNA.
  • The host-to-network layer is not really a layer at all, but an interface (between the network and data link layers).
  • No distinguishment of the physical and data link layers.
  • Prococols other than the IP and TCP were ad hoc.

Summary:

  • The OSI model minus the session and presentation layers) is exceptionally useful for discussing computer networks, but the OSI protocols have not become popular.
  • The TCP/IP model is practically nonexistent, but the protocols are widely used.

Thursday, November 15, 2007

OSI refrence model

OSI (Open Systems Interconnection)

The OSI Reference Model
In 1983, the International Standards Organization (ISO) created the OSI, or X.200, model. It is a multilayered model for facilitating the transfer of information on a network. The OSI model is made up of seven layers, with each layer providing a distinct network service. By segmenting the tasks that each layer performs, it is possible to change one of the layers with little or no impact on the others. For example, you can now change your network configuration without having to change your application or your presentation layer.

The OSI model was specifically made for connecting open systems. These systems are designed to be open for communication with almost any other system. The model was made to break down each functional layer so that overall design complexity could be lessened. The model was constructed with several precepts in mind:

1) Each layer performs a separate function;
2) The model and its levels should be internationally portable; and
3) The number of layers should be architecturally needed, but not unwieldy.

Each layer of the model has a distinct function and purpose:

Application layer--Provides a means for the user to access information on the network through an application. This layer is the main interface for the user to interact with the application and therefore the network. Examples include file transfer (FTP), DNS, the virtual terminal (Telnet), and electronic mail (SMTP).

Presentation layer--Manages the presentation of the information in an ordered and meaningful manner. This layer's primary function is the syntax and semantics of the data transmission. It converts local host computer data representations into a standard network format for transmission on the network. On the receiving side, it changes the network format into the appropriate host computer's format so that data can be utilized independent of the host computer. ASCII and EBCDIC conversions, cryptography, and the like are handled here.

Session layer--Coordinates dialogue/session/connection between devices over the network. This layer manages communications between connected sessions. Examples of this layer are token management (the session layer manages who has the token) and network time synchronization.

Transport layer--Responsible for the reliable transmission of data and service specification between hosts. The major responsibility of this layer is data integrity--that data transmitted between hosts is reliable and timely. Upper layer datagrams are broken down into network-sized datagrams if needed and then implemented using the appropriate transmission control. The transport layer creates one or more than one network connection, depending on conditions. This layer also handles what type of connection will be created. Two major transport protocols are the TCP (Transmission Control Protocol) and the UDP (User Datagram Protocol

Network layer--Responsible for the routing of data (packets) to a system on the network; handles the addressing and delivery of data. This layer provides for congestion control, accounting information for the network, routing, addressing, and several other functions. ). IP (Internet Protocol) is a good example of a network layer interface.

Data link layer--Provides for the reliable delivery of data across a physical network. This layer guarantees that the information has been delivered, but not that it has been routed or accepted. This layer deals with issues such as flow regulation, error detection and control, and frames. This layer has the important task of creating and managing what frames are sent out on the network. The network data frame, or packet, is made up of checksum, source address, destination address, and the data itself. The largest packet size that can be sent defines the maximum transmission unit (MTU).

Physical layer--Handles the bit-level electrical/light communication across the network channel. The major concern at this level is what physical access method to use. The physical layer deals with four very important characteristics of the network: mechanical, electrical, functional, and procedural. It also defines the hardware characteristics needed to transmit the data (voltage/current levels, signal strength, connector, and media). Basically, this layer ensures that a bit sent on one side of the network is received correctly on the other side.
Data travels from the application layer of the sender, down through the levels, across the nodes of the network service, and up through the levels of the receiver. Not all of the levels for all types of data are needed--certain transmissions might not be valid at a certain level of the model.

To keep track of the transmission, each layer "wraps" the preceding layer's data and header with its own header. A small chunk of data will be transmitted with multiple layers attached to it. On the receiving end, each layer strips off the header that corresponds to its respective level.

The OSI model should be used as a guide for how data is transmitted over the network. It is an abstract representation of the data pathway and should be treated as such.