Title | Ccn lab part 1 |
---|---|
Author | Mohit Rajendra Prasad |
Course | MANAGEMENT AND ENTERPRENEURSHIP |
Institution | Visvesvaraya Technological University |
Pages | 48 |
File Size | 1.3 MB |
File Type | |
Total Downloads | 92 |
Total Views | 141 |
7th sem
...
DSCE Lab Manual for CCN PART-A :Implement the following in C/C++ Computer Communication Networks Laboratory
Course code: ECL77 L:P:T:S:0:2:0:0 Exam Hours : 3 Total Hours : 26
Credits : 2 CIE Marks : 50 SEE Marks : 50 Total Marks : 100
COURSE OBJECTIVES: 1. To build the knowledge of networking protocols and interconnections. 2. To impart programming skill sets of C/C++ to implement the functionalities and responsibilities of Data link and networking layer 3. To impart the skill set for students to demonstrate the error control techniques in networking COURSE OUTCOMES CO 1
Apply the concepts of HDLC protocol for data communication
CO 2 CO 3 CO 4 CO 5 CO 6
Design and analyse different routing algorithms Evaluate the quality of service of transmission control protocol Apply the difference between wired and wireless network Evaluate the performance parameters of wired and wireless networks Create different wired and wireless networks for data communication
Mapping of Course Outcomes to Program Outcomes: PO1 PO2 PO3 PO4 PO5 PO6 PO7 3 3 2 1 CO1 3 3 2 2 2 CO2 3 CO3 3 3 2 1 2 CO4 3 2 2 2 2 2 2 1 2 CO5 3 3 2 2 3 CO6 3
Sl no
PO8 1
Course Contents
PO9 2 2 2 2 2 2
PO10 2 2 2 2 2 2
PO11 -
PO12 1 1 1 1 1 1
COs
PART-A Implement the following in C/C++ 1
1. Write a program for a HDLC frame to perform the following for the given CO1,CO2 Data i) Bit stuffing
ii) Character stuffing 2
For the given data, use CRC-CCITT polynomial to obtain CRC code. Verify the program for CO1,CO2 the cases without error & with error.
3
Implementation of Sliding Window Protocol.
4
Implement Dijkstra’s algorithm to compute the shortest routing path.
CO2
5
Write a program for congestion control using leaky bucket algorithm
C03, CO4, CO5
6
Implement Encryption and Decryption of a given message
CO4
C02, CO3, CO5
PART-B Simulation experiments using NS2 / NS3 / NCTUNS 7.
Implement a point to point network with four nodes and duplex links between them. Analyze CO2, CO4,CO5 the network performance by setting the queue size and varying the bandwidth.
8
Implement a four node point to point network with links n0-n2, n1-n2 and n2-n3. Apply TCP CO2, CO4,CO5, agent between n0-n3 and UDP between n1-n3. Apply relevant applications over TCP and UDP CO6 agents changing the parameter and determine the number of packets sent by TCP/UDP.
9
Implement Ethernet LAN using n (6-10) nodes. Compare the throughput by changing the error rate and data rate. Implement Ethernet LAN using n nodes and assign multiple traffic to the nodes and obtain congestion window for different sources/ destinations Implement ESS with transmission nodes in Wireless LAN and obtain the performance parameters. Implementation of any routing algorithm
10 11 12
CO2, CO4,CO5 CO2, CO4,CO5 CO2, CO4,CO5, CO6 CO2, CO4,CO6
Extra programs: 1. Implementation of spanning tree algorithm 2. Implementation of Stop and wait protocol 3. Implement a program to communicate between mobile nodes and suspicious nodes using NS2. 4. Implement UDP wireless communication using NS2 5. Implement TCP communication using NS2
Hardware and Software Requirements: Hardware Requirements
Processor : Pentium 3 or higher RAM : 512MB or more Hard Disk : 16GB or more ( there should be enough space to hold both Linux and Windows)
Software Requirements
Operating System : Windows, Linux Compiler: Turbo C\C++ or Borland C\C++ Simulation Software: NCTUns / NS2
Text Books: 1. Introduction to Network Simulator NS2, Issariyakul, Teerawat, Hossain, Ekram, , Springer US, 2012.
Assessment Pattern:
CIE –Continuous Internal Evaluation Lab (50 Marks) SEE –Semester End Examination Lab (50 Marks) Bloom’s Category Marks (Out of 50) Remember Understand Apply Analyze Evaluate Create Bloom’s Category Remember Understand Apply Analyze Evaluate Create
Performance (Day To Day) 25
Internal Test 25
05 10 05 05
05 10 05 05
Marks Theory(50)
15 15 10 10
Part -A 1. Write a program for a HLDC frame to perform the bit stuffing & de-stuffing for the given data i) Bit stuffing 1. Bit stuffing & de-stuffing using HDLC Framing involves identifying the beginning and end of a block of information within a digital stream. In asynchronous data transmission, since transmissions do not occur at regular intervals, the receiver resynchronizes at the start of each eight bit character by the use of a start bit that precedes and a stop bit that ends each character .In synchronous data transmission bits are transmitted at regular intervals and the receiver has the circuitry that recovers and tracks the frequency and bit transitions of the received data Framing may involve delineating the boundaries between frames that are of fixed length or it may involve delineating between frames that are of variable length. Variable length frames need more information to delineate. The methods available include: Special characters to identify beginning and end of frame Special bit patterns-“flags” to identify the beginning and end of frames and character counts
Bit Stuffing: Flag based synchronization was developed to transfer an arbitrary number of bits within a frame. The figure below shows the structure of an HDLC frame. The beginning and end of an HDLC frame is indicated by the presence of an eight bit flag. The flag in HDLC consists of the byte 01111110 that is HEX 7E . Bit stuffing prevents the occurrence of the flag inside the frame. The transmitter examines the contents of the frame and inserts an extra 0 after each instance of five consecutive 1s. The transmitter then attaches the flag at the beginning and end of the resulting bit stuffed frame. The receiver looks for five consecutive 1s in the received sequence. Five 1s followed by a 0 indicate that the 0 is a stuffing bit and so the bit is removed. Five consecutive 1s followed by 10 indicate a flag. Five 1 s followed by 11 indicate an error. The example below show bit stuffing in HDLC
HDLC Frame The high level data link control protocol is a bit oriented protocol which uses bit stuffing for data transparency. HDLC frame is as shown.
8
8
8
>0
16
8
0111 1110
Address
Control
Data
Checksum
0111 1110
The Control field is used for sequence numbers and acknowledgements and other purposes. The Data field may contain arbitrary information. The Checksum field is a minor variation of the CRC code using CRC-CCITT as the generator. Frames are delimited by 0111 1110 and this sequence is not allowed in the data field.
Algorithm for Bit Stuffing
1. Input data sequence 2. Add start of frame to output sequence 3. for every bit in input a. Append bit to output sequence b. Is a bit 1? Yes: Increment count If count is 5, append 0 to output sequence and reset count No: Set count to 0 4. Add stop of frame bits to output sequence.
Algorithm for Bit Destuffing 1. Input data sequence 2. Remove start of frame to output sequence 3. for every bit in input a. Append bit to output sequence b. Is a bit 1? Yes: Increment count If count is 5, remove 0 from input sequence and reset count No: Set count to 0 4. Remove stop of frame bits to output sequence.
/* Program to simulate bit stuffing & destuffing where the flag byte is 01111110 */
# include # include #include
void main() {
char ch, array[50]={"01111110"},recd_array[50]; int counter=0,i=8,j,k; clrscr();
printf("Enter the original data stream for bit stuffing : \n"); while((ch=getche())!='\r') { if (ch=='1') ++counter;
else counter=0; array[i++]=ch; if (counter==5) /* If 5 ones are encountered append a zero */ { array[i++]='0'; counter=0; } }
array[i]=’\0’; strcat(array,"01111110"); array[i+8]=’\0’;
printf("\nThe stuffed data stream is : %s \n",array);
/* Destuffing */ counter=0; printf("\nThe destuffed data stream is : \n"); for (j=8,k=0;j...