Data Communication Networks - Program #1 - HDLC

Assignment:

Program #1

Assigned:

Feb. 3, 2002, Monday

Due:

Feb. 19, 2002, Wednesday, beginning of class

Note:

No late programs accepted

 

Program #1 simulates HDLC. It is not a group program; every student will submit an original program.The goal of this program is to have the student experience first-hand about data communication transmission and HDLC.

 

The program is to be written in a computer language (C, C++, Java, or ask Dr. Kaplan if you want to program it in another language) and submitted by:

         Hardcopy, and

         Either disk (the disk must contain the program file, input file, output file, and executable) or by email (with all files appended to [email protected]).

Be prepared to demonstrate your program.

 

Accompanying the program must be a one to two page document describing the program.You must be able to present this information orally to the class!

 

The program must include within comments all the information that is required as stated in the syllabus along with

         File Name

         Other Files Needed (i.e., any .h files)

         Input File Name

         Output File Name

 

The program must:

  1. Read in an HDLC frame:
    1. Use 8-bits for the address,
    2. 8-bits for the control,
    3. The information will always be 32 bits,
    4. 16 bits for the FCS,
    5. Use Figure 2.12 on page 88 as a guide,
    6. Read from both input and a file,
    7. But instead of binary, use hexadecimal, so every 8 bits will be a two-character hex number.
  2. Identify and output the type of frame: supervisory, information, or unnumbered.
  3. Identify and output everything that is occurring with the frame.(You dont have enough information to identify everything that is occurring in unnumbered frames; just output that it is an unnumbered frame, the P/F information, and the number for the U bits.)

 


Remember:

HDLC Frame Format

 

Flag

Address

Control

Information

FCS

Flag

Bits:

8

8

8

Variable

16

8

 

01111110

 

 

Use 32 bits

 

01111110

 

Control Field Format

Information Frame

0

N(S)

N(S)

N(S)

P/F

N(R)

N(R)

N(R)

 

Supervisory Frame

1

0

S

S

P/F

N(R)

N(R)

N(R)

 

Unnumbered Frame

1

1

U

U

P/F

U

U

U

 

Examples:

1.Given a frame:

 

7EFB62EFA2B12C77EF7E

 

This is interpreted as:

 

 

Flag

Address

Control

Information

FCS

Flag

Bits:

7E

FB

62

EFA2B12C

77EF

7E

 

Control is 62 (hex) = 0110 0010 (binary)

 

0

1

1

0

0

0

1

0

0

N(S)

N(S)

N(S)

P/F

N(R)

N(R)

N(R)

 

So, it is an information frame with sequence number 110 (binary) or 6 (decimal), the P/F bit is zero, and the system is expecting frame number 010 (binary) or 2 (decimal).

 

 


2.Given a frame:

 

7E109332FBA100BE027E

 

This is interpreted as:

 

 

Flag

Address

Control

Information

FCS

Flag

Bits:

7E

10

93

32FBA100

BE02

7E

 

Control is 93 (hex) = 1001 0011 (binary)

 

1

0

0

1

0

0

1

1

1

0

S

S

P/F

N(R)

N(R)

N(R)

 

 

So, it is a supervisory frame with S bits 01 (binary) or 2 (decimal), meaning that the frame is a reject (REJ) frame, the P/F bit is zero, and the system is rejecting all frames beginning with number 011 (binary) or 3 (decimal).

 

3.Given a frame:

 

7ED2C6BBD27E5CA1BC7E

 

This is interpreted as:

 

 

Flag

Address

Control

Information

FCS

Flag

Bits:

7E

D2

C6

BBD27E5C

A1BC

7E

 

Control is C6 (hex) = 1101 0110 (binary)

 

1

1

0

1

0

1

1

0

1

1

U

U

P/F

U

U

U

 

 

So, it is an unnumbered frame with U bits 01110 (binary) and the P/F bit is zero.