Unformatted text preview:

1 PHYSICALAPPLICATIONDATALINKAPPLICATIONDATALINKPHYSICALLINKCSE 473S Lab Assignment 1 Due date: TBA 1. Goals • To learn the basic infrastructure of layered architecture and service primitives in computer networks. • To design a simplified datalink layer. • To get familiar with the simulator environment used for this and the next lab. 2. Layered architecture For the purpose of this lab, assume that each node in the network has three layers: physical layer, datalink layer (DLC) and application layer. Nodes in the network are connected to one another via links. Each layer in a node can be thought of as an abstract entity that performs certain functions. Similarly, links are also entities that have some functionality. Figure 1 outlines the three layers in a node connected by a link entity. In this lab, you will learn how these entities communicate with one another, and will develop a simple DLC layer entity. Figure 1: Layered Architecture 3. Protocol Data Units 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.2 typedef struct { int snode; /* source node address */ int dnode; /* destination node address */ char data[DATASIZE]; /* data */ } A_PDU_TYPE; typedef struct { int curr_node; /* address of this node */ int next_node; /* address of next node */ A_PDU_TYPE a_pdu; /* application pdu */ enum boolean error; } D_PDU_TYPE; typedef struct { int type; D_PDU_TYPE d_pdu; /* dlc pdu */ } PH_PDU_TYPE; typedef struct { union { /* structure containing a_pdu */ A_PDU_TYPE a_pdu; /* d_pdu or ph_pdu as a union */ D_PDU_TYPE d_pdu; PH_PDU_TYPE ph_pdu; } u; int type; /* One of: TYPE_IS_A_PDU, TYPE_IS_D_PDU, TYPE_IS_PH_PDU */ } PDU_TYPE; 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. 4. Service Primitives Inter layer communication takes place by means of service primitives. At the physical-datalink layer interface, there are two service primitives: PH_DATA_request and PH_DATA_indication. At the datalink-application layer interface, there are two service primitives: DLC_DATA_request and DLC_DATA_indication. A service primitive, for example, DLC_DATA_request, is implemented as two procedures: ApplicationToDatalink() and DatalinkFromApplication(). ApplicationToDatalink() puts a_pdu's into the dlc entity, while DatalinkFromApplication() gets a_pdu's from the dlc entity. Notice that ApplicationToDatalink() is called by the application layer to send a_pdu's, and DatalinkFromApplication() is called by the datalink layer to receive these a_pdu's.3 5. Methodology In this lab, you will design the DatalinkToPhysical and DatalinkToApplication functions for the datalink layer. The outline of these functions is given in the Appendix, and provided in the file dlc layer.c 1) In the file at http://www.cse.wustl.edu/~cse473s/labs/lab1.zip you will find the following. • sim.src/pdu.h: Header file containing some declarations and definitions. You don't need to include this file anywhere in your source code because it is already included in dlc layer.h. You will need to use some of the function definitions provided in this file, like pdu_alloc()and pdu_free() • components.src/dlc layer.c: File containing the outline for the lab. • lab1.vcproj: Visual Studio project file for the lab. • test/3nodes_basic.config: This file specifies the configuration of the network. In this lab you will only use a 3 node configuration with point-to-point links. This is a basic configuration with 3 point-to-point nodes. App1 sends to App2; App2 sends to App3; App3 sends to App1. The configuration is shown in figure 2 (next page). • test/lab1.exe: A sample executable file to familiarize you with the graphical user interface. 2) Unzip the lab1.zip file into your user directory at CEC. Once unzipped you should have the following folder structure. H:/cse473s/lab1. (You can deviate from this path but you may have to change settings in the project file to do so) 3) You need to set an environmental variable for execution. Follow these instructions closely. • Go to Start/Settings/Control Panel/System. • Go to the Advanced tab • Click on Environment Variables • Under User Variables, click New. • Enter the following; o Variable Name: CISE_LIBRARY_LAB1 o Variable Value: H:\cse473s\lab1\sim.src • Click OK for all open dialogs. 4) Experiment with lab1.exe. Refer to section 6 for instructions on how to run your program. 5) Study the source code carefully. (Don't worry about the configuration files).4 link3phy1dlc1app1phy2dlc2app2app3dlc3phy3link1link2 Figure 2: Three node configuration 6) Now you are ready to write your program for the datalink layer. All you have to do in this lab is fill in the appropriate code for DatalinkToPhysical() and DatalinkToApplication() in dlc_layer.c. 7) To start, open lab1.vcproj file (Opens using Visual Studio .NET). To build the project, use the Build/Build menu option. To execute your program, use the Debug/Start menu option.5 8) Execute your version of the code and use the configuration file to make sure it works. 9) You can use any of the Windows PCs in CEC or the Oasis terminal server to work on this project. If you are unfamiliar with Oasis, please


View Full Document
Download Lab Assignment 1
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lab Assignment 1 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lab Assignment 1 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?