6.4

Framing

6.4.1

Why framing is necessary

Encoded bit streams on physical media represent a tremendous technological accomplishment, but they, alone, are not enough to make communication happen. Framing helps obtain essential information that could not, otherwise, be obtained with coded bit streams alone. Examples of such information are: 

  • which computers are communicating with one another
  • when communication between individual computers begins and when it terminates
  • a record of errors that occurred during the communication
  • whose turn it is to "talk" in a computer "conversation"

Once you have a way to name computers, you can move on to framing, which is the next step. Framing is the Layer 2 encapsulation process; a frame is the Layer 2 protocol data unit.

 

6.4

Framing

 

6.4.2

Frame format diagram

When you are working with bits, the most accurate diagram that you could use to visualize them is a voltage versus time graph. However, since you are usually dealing with larger units of data and addressing and control information, a voltage versus time graph could become ridiculously large and confusing. Another type of diagram that you could use is the frame format diagram, which is based on voltage versus time graphs. You read them from left to right, just like an oscilloscope graph. The frame format diagram shows different groupings of bits (fields) that perform other functions.

 

6.4

Framing

 

6.4.3

Three analogies for frames

Following are three analogies that can help explain frames.

Picture Frame Analogy
A picture frame marks the outside of a painting or photograph. It makes the painting or photograph easier to transport and protects the painting or photograph from physical damage. In computer communication, the picture frame is like the frame, while the painting or photograph is like the data. The frame marks the beginning and end of a piece of data, and makes the data easier to transport. The frame helps protect the data from errors.

Packaging/Shipping Analogy
When you ship a large, heavy package, you usually include various layers of packing material. The last step, before you put it on a truck to be shipped, is to place it on a pallet and wrap it. You can relate this to computer communications by thinking of the securely packed object as the data, and the whole, wrapped package on the pallet as the frame.

Movies/Television Analogy
Movies and TV work by flashing a series of frames, or still pictures, at a rate of 25 frames per second for movies, and 30 frames per second for television. Because of the rapid movement of each frame, your eyes see continuous motion instead of the individual frames. These frames carry visual information in chunks, but all of them together create the moving image.

 

6.4

Framing

 

6.4.4

A generic frame format

There are many different types of frames described by various standards. A single generic frame has sections called fields, and each field is composed of bytes. The names of the fields are as follows:

  • frame start field
  • address field
  • length / type / control field
  • data field
  • frame check sequence field
  • frame stop field

 

6.4

Framing

 

6.4.5

Frame start fields

When computers are connected to a physical medium, there must be a way they can grab the attention of other computers to broadcast the message, "Here comes a frame!" Various technologies have different ways of doing this process, but all frames, regardless of technology, have a beginning signaling sequence of bytes.

 

6.4

Framing

 

6.4.6

Address fields

All frames contain naming information, such as the name of the source computer (MAC address) and the name of the destination computer (MAC address).

 

6.4

Framing

 

6.4.7

Length/type fields

Most frames have some specialized fields. In some technologies, a length field specifies the exact length of a frame. Some have a type field, which specifies the Layer 3 protocol making the sending request. There is also a set of technologies where no such fields are used.

 

6.4

Framing

 

6.4.8

Data fields

The reason for sending frames is to get higher-layer data, ultimately the user application data, from the source computer to the destination computer. The data package you want to deliver has two parts. First, the message you want to send and second, the encapsulated bytes that you want to arrive at the destination computer. Included along with this data, you must also send a few other bytes. They are called padding bytes, and are sometimes added so that the frames have a minimum length for timing purposes. LLC bytes are also included with the data field in the IEEE standard frames. Remember that the Logical Link Control (LLC) sub-layer takes the network protocol data, an IP packet, and adds control information to help deliver that IP packet to its destination. Layer 2 communicates with the upper-level layers through Logical Link Control (LLC).

 

6.4

Framing

 

6.4.9

Frame error problems and solutions

All frames (and the bits, bytes, and fields contained within them) are susceptible to errors from a variety of sources. You need to know how to detect them. An effective, but inefficient way to do this is to send every frame twice, or to have the destination computer send a copy of the original frame back to the source computer before it can send another frame.

Fortunately, there is a more efficient and effective way, one in which only the bad frames are discarded and retransmitted. The Frame Check Sequence (FCS) field contains a number that is calculated by the source computer and is based on the data in the frame. When the destination computer receives the frame, it recalculates the FCS number and compares it with the FCS number included in the frame. If the two numbers are different, an error is assumed, the frame is discarded, and the source is asked to retransmit.

There are three primary ways to calculate the Frame Check Sequence number:

  • cyclic redundancy check (CRC) - performs polynomial calculations on the data
  • two-dimensional parity - adds an 8th bit that makes an 8 bit sequence have an odd or even number of binary 1's
  • Internet checksum - adds the values of all of the data bits to arrive at a sum

 

6.4

Framing

 

6.4.10

Stop frame field

The computer that transmits data must get the attention of other devices, in order to start a frame, and then claim it again, to end the frame. The length field implies the end, and the frame is considered ended after the FCS. Sometimes there is a formal byte sequence referred to as an end-frame delimiter.