Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

The Higher Institute of Engineering

El-Shorouk City

Electronics, Communication, and Fourth year – 1st semester


Computer Engineering Dept.
Network - Sheet (5) Dr. Ahmed El Kasas

1. Define framing and give the reason it is needed.

Answer:

 Bits are packed into frames of manageable size.


 Framing in the data link layer adds sender address and destination address, as well as other
control bits.

m
 A message can be packed in one or multiple frames.

er as
 Frame size is kept such that flow and error control become efficient

co
 Framing divides a message into smaller entities to make flow and error control more

eH w
manageable

o.
2. Explain why flags are needed when we use variable-size frame.
rs e
ou urc
Answer:

Flags are needed to separate a frame from the previous frame and the next frame.
o

3. Compare and contrast byte stuffing and bit stuffing.


aC s
vi y re

Answer:

Character-oriented protocols use byte-stuffing to be able to carry an 8-bit pattern that is the
same as the flag. Byte-stuffing adds an extra character to the data section of the frame to escape
ed d

the flag-like pattern. Bit-oriented protocols use bit-stuffing to be able to carry patterns similar to
the flag. Bit-stuffing adds an extra bit to the data section of the frame whenever a sequence of
ar stu

bits is similar to the flag.

4. In a byte-oriented protocol, should we first unstuff the extra bytes and then remove
the flags or reverse the process
sh is

Answer:
Th

Byte stuffing involves the addition of a special byte to the data section of the frame when
there is a character with the same pattern as the flag. An extra byte is stuffed in the data
section called the escape character which has a pre-defined bit pattern. Whenever the receiver
encounters the ESC character, it removes it from the data section and treats the next character
as data, not a delimiting flag.

5. In a bit-oriented protocol, should we first unstuff the extra bits and then remove the
flags or reverse the process.

Answer:

1
https://www.coursehero.com/file/36566361/sheet-5-answerpdf/
The flags are the delimiters of the original frames. We need first to unstuff the frame to
remove extra bits. The flags are removed later when we want to deliver data to the upper
layer.

6. Byte stuff the following frame payload in which E is the escape byte, F is the flag
byte, and D is a data byte other than an escape or a flag character.

DEDDFDDEEDFD

Answer:

Each escape or flag byte must be pre-stuffed with an escape byte. The following shows the
result. The red bytes show the added ones.

m
er as
7. stuff the following frame payload in which E is the escape byte, F is the flag byte,

co
and D is a data byte other than an escape or a flag character.

eH w
o.
EEDEFDDEFEEDDD

Answer: rs e
ou urc
o
aC s

8. Bit stuff the following frame payload:


vi y re

0001111111001111101000111111111110000111

Answer:
ed d

The following shows the result. We inserted extra 0 after each group of five consecutive 1’s.
ar stu

00011111011001111100100011111011111010000111

9. Unstuff the following frame payload:


sh is

00011111000001111101110100111011111000001111
Th

Answer:

00011111000000111110011101001110111110000001111

10. Use drawing to explain where the data link layer is implemented.

Answer:

2
https://www.coursehero.com/file/36566361/sheet-5-answerpdf/
m
Figure 1

er as
Figure 1 shows typical host architecture. For the most part, the link layer is implemented in a

co
eH w
network adapter, aka a network interface card (NIC). At the heart of the network adapter is
the link-layer controller, usually a single, special-purpose chip that implements many of the

o.
link-layer services (framing, link access, error detection, and so on). Thus, much of a link-
rs e
layer controller’s functionality is implemented in hardware. Network adapters are being
ou urc
integrated onto the host’s motherboard—a so-called LAN-on-motherboard configuration.
Figure1 shows a network adapter attaching to a host’s bus (e.g., a PCI or PCI-X bus), where it
looks much like any other I/O device to the other host components. It also shows that while
o

most of the link layer is implemented in hardware, part of the link layer is implemented in
aC s

software that runs on the host’s CPU. The software components of the link layer implement
vi y re

higher-level link layer functionality such as assembling link-layer addressing information and
activating the controller hardware. On the receiving side, link-layer software responds to
controller interrupts (e.g., due to the receipt of one or more frames), handling error conditions
and passing a datagram up to the network layer. Thus, the link layer is a combination of
ed d

hardware and software—the place in the protocol stack where software meets hardware.
ar stu
sh is
Th

3
https://www.coursehero.com/file/36566361/sheet-5-answerpdf/

Powered by TCPDF (www.tcpdf.org)

You might also like