4B/5B Encoding Simulation

written by Teresa Carrigan



Top

WHAT IS IT?

This model demonstrates the 4B/5B transmission encoding method. 4B/5B is designed to limit the number of consecutive zeroes, and is used by 100Base-FX networks to achieve a 100Mbps data transmission rate.

Top

HOW IT WORKS

A random 16-bit pattern is generated. This is the data that we want to transmit on our 100Mbps network. Starting from the left-most bit, each set of 4 bits is replaced by its 5-bit 4B/5B equivalent. The 4B/5B encoding of the data is then transmitted over the network using NRZI transmission encoding. For each bit sent, both a synchronization clock pulse and the transmission waveform are displayed.

Top

HOW TO USE IT

The setup button generates a random bit pattern, and initializes variables.

The slow-motion slider is an easy way to adjust the speed of the display. Set it to zero if you want to show the final result as quickly as possible. 0.3 is a good setting for most purposes.

The step button demonstrates the next step of the method, and then stops so you can take notes. The first few steps convert the next set of 4 bits into 4B/5B encoding. Once the full message is encoded, each step processes the next bit of the encoded message. Taking notes after each step is useful when you are first learning 4B/5B or NRZI.

The go button processes the remaining bits, at a speed determined by the slow-motion slider. This is useful when you do not need to take notes between each step, or do not wish to press the step button sixteen times to get an answer. If you want to pause the demonstration, simply click the go button a second time and it will stop after it finishes the current step. You may then click go a third time to resume.

The show-again button starts the exact same data bit pattern from the beginning.

Top

THINGS TO NOTICE

Some encoding schemes are prone to loss of synchronization due to too many time slices at the same voltage level. What is the greatest number of time slices that can be produced by 4B/5B-encoding?

If the average voltage is not zero, then there is a DC component to the signal. This can cause signal distortion and possibly even damage equipment. Does 4B/5B have this problem?

A magnetic disk can store more bits per inch if there are fewer transitions between high and low signal (positive and negative magnetic charge). How many transitions does 4B/5B usually have, compared to other encoding schemes? Would this make a suitable encoding for use with magnetic disks, or should it be restricted to use with networks?

Top

THINGS TO TRY

Set slow-motion to 0.3, click random, and then click go.

Set the encoding choice box to the type of encoding you want to drill, then click setup. Attempt one bit at a time on paper, and then click the step button to check that you did that bit correctly.

Top

EXTENDING THE MODEL

Allow the user to input a starting bit pattern.

Modify to use 8B/10B or 8B/6T encoding. These encodings allow even faster data transmission rates.

Modify so that the signal is generated first, and then translated into bits.

Top

NETLOGO FEATURES

Extensive use is made of NetLogo commands substring and member? in translating the original data bit pattern to the RLL encoded bit pattern.

Top

RELATED MODELS

Top

CREDITS AND REFERENCES

This model was written by Teresa W. Carrigan, 2004.

Permission to use, modify or redistribute this model is hereby granted, provided that both of the following requirements are followed:

  1. this copyright notice is included.
  2. this model will not be redistributed for profit without permission from Teresa Carrigan.
Contact Teresa Carrigan for appropriate licenses for redistribution for profit.

To refer to this model in academic publications, please use: Carrigan, T. (2004). 4B/5B Encoding Simulation model. Blackburn College, Carlinville, IL.

In other publications, please use: Copyright 2004 by Teresa W. Carrigan. All rights reserved.

Top

FOR MORE INFORMATION

For more information on 4B/5B Transmission Encoding, see:
  1. Forouzan, B. Data Communications and Networking, Third Edition, McGrawHill, pages 95-98; 348-349.


Home

Applets on this website were written by Teresa Carrigan in 2004, for use in computer science courses at Blackburn College, with the exception of the Fireworks applet. The applets made with NetLogo require Java 1.4.1 or higher to run. The applets made with NetBeans require Java 1.4.2 or higher to run. Applets might not run on Windows 95 or Mac OS 8 or 9. You may obtain the latest Java plugin from Sun's Java site.