Data Communication Networks
- Program #1 - HDLC
|
Assignment: |
Program
#1 |
|
Assigned: |
|
|
Due: |
|
|
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:
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.