Professional Documents
Culture Documents
Network
Link
Virtual data path
1
18/01/2018
pp. 78-85
A data frame is used to transport data across the network
2
18/01/2018
Many method can be used in framing, Byte count, Flag bytes with byte
stuffing, Flag bits with bit stuffing
Byte count
Frame begins with a count of the number of bytes in it
Simple, but difficult to resynchronize after an error
Expected case
Error case
3
18/01/2018
Special flag bytes delimit frames; thus occurrences of flags in the data must be
stuffed (escaped)
Each frame starts with special start and end bytes (flag bytes). Here will imagine it
as same byte, FLAG. After error, can always find start of next frame.
Q. What if flag byte itself is in the data?
A. Insert special escape byte (ESC) before each FLAG in data. Removed at far end. This is
called byte stuffing or character stuffing.
Frame format
Stuffing examples
Data bits
Transmitted bits
with stuffing
4
18/01/2018
Flow Control
Error Control
Error control repairs frames that are received in error
Requires errors to be detected at the receiver
Typically retransmit the unacknowledged frames
Timer protects against lost acknowledgements
Detecting errors and retransmissions are next topics.
Flow Control
Prevents a fast sender from out-pacing a slow receiver
Receiver gives feedback on the data it can accept
Rare in the Link layer as NICs run at “wire speed”
o Receiver can take data as fast as it can be sent
Flow control is a topic in the Link and Transport layers.
5
18/01/2018
The Rules
All bit positions that are powers of 2 are parity bits (P) (1, 2, 4, 8, 16, etc.)
For parity bit position n: skip n - 1 bits, check n bits, skip n bits, check n
bits,
P1: n = 1, skip 0, check 1, skip 1, check 1, ...
P2: n = 2, skip 1, check 2, skip 2, check 2, ...
P3: n = 4, skip 3, check 4, skip 4, check 4, ...
P4: n = 8, skip 7, check 8, skip 8, check 8, ...
More in
seminar
6
18/01/2018
More in
seminar
(11, 7) Hamming code adds 4 check bits and can correct 1 error
Data Communication and Network Routing 13
7
18/01/2018
8
18/01/2018
Checksum treats data as N-bit words and adds N check bits that are
the modulo 2N sum of the words
Ex: Internet 16-bit 1s complement checksum
Properties:
Improved error detection over parity bits
Detects bursts up to N errors
Detects random errors with probability 1-2N
Vulnerable to systematic errors, e.g., added zeros
9
18/01/2018
Start by adding 0s to
frame and try dividing
10
18/01/2018
11
18/01/2018
12
18/01/2018
Single letters
Closing flag
& Block CC
number of chars
Control character
Opening Flag
13
18/01/2018
Perform the same steps until only two symbols are left.
Determine the codeword by reading from left to right. The first bit being read is the
least significant one.
14
18/01/2018
A9 --> 1 1
B 0
B9 --> 1 0 1
C5 --> 0 1 1 C 1
D5 --> 0 1 0
D 0
1
E2 --> 0 0 1 1
F2 --> 0 0 1 0 E 1 0
1
G2 --> 0 0 0 1 F
0
0
H2 --> 0 0 0 0
G 1 0
More in H 0 Another
seminar possible
answer
A9 --> 1 1
B9 --> 1 0
C5 --> 0 1 1
If there were N symbols then N codewords would be sent. In the case of
fixed length binaryD5
codes
--> this would
0 1 be0 represented by 3N bits.
How does this compare with those required by this example of Huffman
E2 --> 0 0 1 1
encoding?
F2 --> 0 0 1 0 Message Prob No of bits N messages
Therefore there has been a saving of 0.28N bits in
comparison with fixed length binary each of 3 bits. A 9/36 2 18/36N
G2 --> 0 0 0 1
B 9/36 2 18/36N
Redundancy it can shown that the ideal code for this
H2 2.53N
sequence of symbols would take --> 0bits 0ie. this
0 is 0 C 5/36 3 15/36N
the actual information content of the stream of
D 5/36 3 15/36N
codewords.
Thus for fixed length binary codes the E 2/36 4 8/36N
Information content
F 2/36 4 8/36N
Redundancy = 1- -------------------------
Number of bits sent G 2/36 4 8/36N
15
18/01/2018
16
18/01/2018
17
18/01/2018
18
18/01/2018
19
18/01/2018
20
18/01/2018
Forward
Blocked
21
18/01/2018
Broadcast Storms:
22
18/01/2018
Redundancy:
Increases the availability of the network topology by
protecting the network from a single point of failure.
In a Layer 2 design, loops and duplicate frames can occur,
having severe consequences.
The Spanning Tree Protocol (STP) was developed to
address these issues.
STP ensures that there is only one logical path between all
destinations on the network by intentionally blocking
redundant paths that could cause a loop.
The switches running STP are able to compensate for failures
by dynamically unblocking the previously blocked ports and
permitting traffic to traverse the alternate paths.
23
18/01/2018
Because
STP
S1
PC1 F0/2
S2 forwards
forwards
issends
in useisathe
in blocking
and
the S3 has
state,
broadcast
placed port–
the
broadcast.broadcast
broadcast. F0/2
but not is not
in blocking
to
forwarded toback
state S3. avoidto S2. – NO
a loop.
LOOP!
S3 port
activated
Trunk 1
S3 port back to Failure
S2
PC1
S3forwards
and
Sends
S1 a
the
forward the Trunk 1 comes back
blocking mode.
broadcast.
broadcast.
broadcast. up.
24
18/01/2018
Terminology:
Root Bridge:
A single switch used as the reference point for all
calculations.
Root Ports:
The switch port closest to the root bridge.
Designated Port:
All non-root ports that are still permitted to forward traffic
on the network.
Non-designated Ports:
All ports configured to be in a blocking state to prevent loops.
Bridge MAC
Priority Address
2 6
25
18/01/2018
Election Process:
All switches in the broadcast domain participate.
After a switch boots, it sends out Bridge Protocol Data Units (BPDU)
frames containing the switch BID and the root ID every 2 seconds.
The root ID identifies the root bridge on the network.
By default, the root ID matches the local BID for all switches on the
network.
In other words, each switch considers itself as the root bridge when it boots.
Election Process:
As the switches forward their BPDU frames, switches in the
broadcast domain read the root ID information from the BPDU
frame.
If the root ID from the BPDU received is lower than the root ID
on the receiving switch, the receiving switch updates its root
ID identifying the adjacent switch as the root bridge.
The switch then forwards new BPDU frames with the lower root
ID to the other adjacent switches.
Eventually, the switch with the lowest BID ends up being
identified as the root bridge for the spanning-tree instance.
26
18/01/2018
Burgess, M., 2003. Principles of Network and System Administration. 2nd ed.
Chichester: John Wiley and Sons Ltd.
Hallberg, B., 2005. Networking: A Beginner’s Guide. 4th ed. Osborne: Mcgraw-Hill.
Limoncelli, T. & Hogan, C., 2001. The Practice Of System and Network
Administration. London: Addison-Wesley.
Lowe, D., 2005. Networking All-In-One Desk Reference For Dummies. 2nd ed. New
York: Hungry Minds Inc..
Olifer, N. & Olifer, V., 2005. Computer Networks: Principles, Technologies And
Protocols For Network Design. Chichester: John Wiley And Sons Ltd.
Stallings, W., 2003. Data And Computer Communications. 7th ed. New York:
Prentice Hall.
Subramanian, M., (2000). Network Management: An Introduction to Principles and
Practice. Chichester: Addison-Wesley.
Tanenbaum, A., 2002. Computer Networks. London: Prentice Hall Ptr.
Journals
The Institute of Engineering and Technology
27