A quick and dirty model of a SONET transmitter
I have been involved with SONET networking for five years (since 1997 or thereabouts). Most of my work involved either worrying about the physics of optical data transport in WDM systems, or, more recently, designing OC-48 and OC-192 optical line cards for various types of telecom switches. However, I have never really had to worry about higher-layer SONET behavior. Until now, that is.
For a variety of reasons, it has now become necessary for me to understand the detailed workings of the SONET overhead under various scenarios. Two specific behaviors are of particular interest:
The best way to understand something is to build a model of it. Originally, I thought about building a fairly elaborate SystemC model of a SONET transmitter and receiver, implementing pointer processing, frame boundary detection, indicator OH byte reading/writing, and so on. The advantage of this approach is that it would be very close to hardware -- that is, the model's modules (registers, state machines, decoders, etc.) would behave very much like the actual modules (blobs of Verilog) of a real SONET framer. However, as I thought about it, the large magnitude of that project quickly became apparent and I decided against it.
Instead, I decided to write a quick 'n dirty Perl program which simply outputs SONET frames into a file. Because I know basic Perl fairly well, and the language makes it easy to hack something together fairly quickly, it seemed to be the logical choice. Also, since I was mostly interested in the behavior (i.e. algorithms) of the SONET transmitter, I could capture enough of its workings in Perl that modeling would be instructive and useful.
I also considered writing the model in Python, which would have allowed a more OO model. The OO model would actually be closer to a hardware instantiation of a SONET transmitter, which I would have liked. Also, I like Python a lot because it is both easy to use and elegant. However, not many other people know Python, and one objective of this model was to share it. Therefore, I decided to go with Perl.
The model outputs an STS-12c frame, producing both TOH and the SPE-layer POH. I am not interested in VT layer POH, and it is not applicable to concatenated frame, so the payload of the SPE carries "xx", indicating payload data. The follwing OH bytes are implemented:
In the interest of cooperative learning, I am making my little Perl model available for other students of SONET networking. The program and some (hopefully) explanatory pdf drawings are contained in the tarball available under:
Note that the model uses the Bit::Vector package of Steffen Beyer. You can download that package at http://www.engelschall.com/~sb/download/
Please feel free to hack, augment, modify, correct, or use this program in any way you see fit. I am releasing it under the GPL. I am interested in hearing from anybody who has made use of the model. Just send me an e-mail. I would be particularly interested in corresponding with people who identify bugs in my understanding of SONET (or in the program), as well as with those who have added other behaviors to this model.
Return to Stuart Brorson's home page
Please send your questions, comments, or reactions about this web page to
Stuart Brorson.
Page last updated 10.17.2002.