CIS 677 LAB III: Ethernet. Media Access Control Due on Fr, May 29, 1998, In class |
For the purpose of this lab, assume that each node in the network has three layers: physical layer, datalink layer (DLC), and application layer. Datalink layer (DLC) is composed of the media access control sublayer and the logical link sublayer (Figure 1). The nodes in the network are connected via a bus. Each layer in a node can be thought of as an abstract entity that performs certain functions.
|
Each layer communicates through Protocol Data Units (PDU). The application layer PDU is called A PDU, the DLC PDU is called D_PDU, and the physical layer PDU is called PH_PDU. The A_PDU, D PDU and PH_PDU formats are defined below. These definitions, together with some others are provided to you in the file pdu.h .
|
The application layer sends an a_pdu to the DLC layer. The DLC layer receives this a_pdu and encapsulates it within a d_pdu. It then performs its functions on the d_pdu and sends the d_pdu to the physical layer. In the same manner, the physical layer receives the d_pdu, encapsulates it within a ph_pdu and sends it to the link entity. The link entity receives a ph_pdu from one physical layer and delivers it to the physical layer at the other end. When a physical layer receives a ph_pdu from the link, it extracts the d_pdu from it and sends it to the dlc layer. The dlc layer checks the d_pdu for errors, extracts the a_pdu and sends it to the application layer.
Under the IEEE 802 series of standards, the data link layer of the OSI Reference Model is subdivided into two sublayers: Logical Link Control (LLC) and the Medium Access Control (MAC). The MAC sublayer is responsible for checking the channel and transmitting data if the channel is idle, cheking for occurrence of a collision, and taking a series of predefined steps if a collision is detected. The MAC layer is an interface between user data and the physical placement and retrieval of data on the network. In our lab we will focus more on one of major functions performed by the MAC sublayer: transmission medium access management. The activities associated with this function are:
CSMA/CD can be described as a listen-before-acting access method. Thus, the first function associated with transmission media access management is to find out whether any data is already being transmitted on the network and, if so, to defer transmission. During the listening process, each station attempts to sense the carrier signal on the bus, hence the name carrier sense (CS) is used for this access method.
Under Manchester encoding, a transition occurs at the middle of each bit period. Also a binary 1 is represented by a high-to-low transition, while a binaty 0 is represented by a low-to-high voltage transition. Thus, an examination of the voltage on the medium of a base-band network enables a station to determine whether a carrier is present. If a carrier signal is found, the station with data to transmit will continue to monitor the channel. When the current transmission ends, the station will then transmit its data, while checking the channel for collisions. Since Ethernet and IEEE 802.3 Manchester encoded signals have a 1 volt average DC voltage level, a collision results at an average DC level of 2 volts. Thus, a tranceiver or network interface card can detect collision by monitoring the voltage level of the Manchester line signal.
If a collision is detected during transmission, the transmitting station will cease transmitting of data and initiate transmitting of a jam pattern. The jam pattern consists of 32 to 48 bits. These bits can have any value other than the CRC value that corresponds to the partial frame transmitted before the jam. The transmission of the jam pattern ensures that the collision lasts long enough to be detected by all stations on the network.
Once a collision is detected, the transmitting station waits a random number of time slots before
attempting to retransmit. The term "time slot" represents 512 bits on a 10-Mbps network. The actual
number of slot times the station waits is selected by a randomization process, formaly known as truncated
binary exponential backoff. Under this randomization process, a randomly selected integer r defines the
number of slot times the station waits before listening to determinate whether the channel is clear. At the
selected slot, the station begins to retransmit the frame, while listening for another collision. The number
of time slots to delay before the n-th retransmission attempt is chosen as a uniformly distributed random
integer r in the range between 0 and
, where k=min(n,10). After a user-defined maximum number of
attempts, the MAC entity assumes that some problem exists, gives up, and reports failure to
LLC.
If the cable is busy, the station waits until it goes idle; otherwise it transmits immediately. If two or more stations simultaneously begin transmitting on an idle cable, they will collide. All colliding stations then terminate their transmission, wait a random time, and repeat the whole process all over again.
In this lab you are going to implement the collision backoff and retransmission function.
cn collision_detect(Data_Link_Connectiont *mac_layer).
This function will be based on the algorithm explained in Section 5.3.
Here there are the explanations for some variables and functions you may use (in addition to those described in Section 3).
Data_Link_Connectiont *mac_layer /* This is a pointer to the data structure of MAC layer */
int min(int a, int b) /* Returns the minimum of a and b */
float ran_numb() /* Returns a uniformely distributed random float in the range 0 to 1 */
retransmit(mac_layer, int delay) /* Call this function to retransmit */
Your code should calculate the variable delay, which gives in nanoaseconds the retransmission time and it should be a multipler of time_slot interval.
|
In this lab, you will design the cn_collision_detect function. for the mac sublayer.
Login to an HP machine. NOTE: This program works only on HP machines. At your unix prompt, type enet_demo. A window with the simulator interface will open on your terminal.
Figure 2 shows the the 3-nodes configuration bus. Each node has 3 layers denoted by three squares. All the three nodes are connected to the same bus.
The top of the main simulator window has a menu bar that has the following selections.
|
You must submit hard copies of the following:
If you have any questions, please send an e-mail to durresi@cis.ohio-state.edu