MCS-042 Solved Assignments
MCS-042 Solved Assignments
MCS-042 Solved Assignments
in
https://www.facebook.com/IGNOUHelp.in
Q 1: Assume a data stream is made of “000010” Encode this stream using the
following encoding schemes.
(i) Manchester
(ii) Differential Manchester
(iii) UNI polar
(iv) Polar NR Z-1
(v) RZ
Also discuss the usefulness of each
scheme. Ans:
(i)
A method of transmitting bits which enables the receiver to easilysynchronise with the
sender.
A simple way of signalling bits might be to transmit a high voltagefor some period for a
1-bit and a low voltage for a 0 bit:
www.IGNOUHelp.in
Bits Sent: 1 1 0 0
Signal: High ___________ Low |___________
Time: -> . . . . .
However, when several identical bits are sent in succession, thisprovides no information
to the re ceiver about when each bit startsand stops.
Manchester encoding splits each bit period into two, and ensuresthat there is always
a transition between the signal levels in themiddle of each bit. This allows the receiver to
synchronise withth e sender.
In normal Manchester encoding, a 1-
bit is transmitted with a highvoltage in the first period, and a low voltage in the
second, andvice verse for the 0 bit:
Bits Sent: 1 1 0 0
Signal: High __ __ __ __ Low |__| |_____|
|__| Time: -> . ' . ' . ' . ' .
In Differential Manchester encoding, a 1-
bit is indicated by makingthe first half of the signal equal to the last half of the previousbit's
sign al and a 0-bit is indicated by making the first half of thesignal opposite to the last half of the
previous bit's s ignal. That is,a zero bit is indicated by a transition at the beginning of the bit.
Like normal Manchester encoding, there is always a transition inthe middle of the
transmission o f the bit.
Differential Manchester Encoding
Bits Sent: 1 1 0 0
Signal: High ____ __ __ __ Low |_____| |__|
|__| Time: -> . ' . ' . ' . ' .
With each bit period half as long, twice as much bandwidth isrequired when using either
of the Manchester
www.IGNOUHelp.in
(iii)
Unipolar Coding
The most basic transmission code is unipolar or unbalanced coding. In this scheme each
discrete variable is transmitted with a different assigned level, 0V and for example +2.5V. But
this holds a number of disadvantages:
The average power is two times other bipolar codes
This results in loss of timing and data because a receiver/repeater cannot optimally
discriminate ones and zeros.
Repeaters/receivers require a minimum pulse density for proper timing extraction. Long
strings of ones or zeros contain no timing information and lead to timing jitter (when a
clock recovery is used) and possible loss of synchronization.
www.IGNOUHelp.in
(iv)
1 = signal on
(v)
NRZI Nonreturn to Zero Inverted
1 = change of signal level (on-off or off-on)
0 = no change of signal level
NRZI is a differential encoding used in 4B/5B on fast ethernet. It fixes problems in
clocking during long strings of 1 bits. The problems are the DC component and the lack of clock
recovery during long string of 0 bits.
www.IGNOUHelp.in
G = 1x8 + 0x7 + 0x6 + 1x5 + 1x4 + 0x3 + 1x2 + 0x1+ 1x0
or
G = 100110101
The generating polynomial divides the binary message to determine the remainder which
is then subtracted from the message to get a message that is evenly divided by the generating
polynomial. At the receiving end, if the message divided by the generating polynomial
yields a remainder, it must be corrupted. Both sides have to use the same generating polynomial.
Also, so that no data in the message must be destroyed to subtract the remainder, n-1 zeros are
added to the original message before dividing.
All arithmetic is done in one's complement form, so that there are no carries or
borrows. One's complement arithmetic uses an exclusive or (XOR) to perform both addition
and subtraction:
(0+1) = (0-1) = 1.
For example, if the message is 100101001 and the generating polynomial is 10011, then:
1. Append 4 zeros to the message (100101001,0000)
2. Do one's complement polynomial division:
3. 10001 1011
4. ----------------------------
5. 10011 | 100101001,0000
6. 10011
7. --------
8. 11001
9. 10011
10. --------
11. 10100
12. 10011
13. --------
14. 11100
15. 10011
16. --------
17. 11110
18. 10011
19. --------
20. 1111 = remainder
21.
22. Subtract the remainder form the message and send the result.
www.IGNOUHelp.in
23. 100101001,0000
24. 1111
25. ---------------
26. 1001010011111 = the message transmitted to the other end
You can check the result by dividing the transmitted message by the
generating polynomial. It will be zero.
In this case, B is transmitting to A. Both are within radio range of each other. Now C wants
to transmit to D. As usual, it senses the channel and hears an ongoing transmission and
falsely concludes that it cannot transmit to D. But the fact is transmission between C and D
would not have caused any problems because, the intended receivers C and D are in a
www.IGNOUHelp.in
different range. This is called exposed station problem.
This 3-way handshake process is also designed so that both ends can initiate and negotiate
separate TCP socket connections at the same time. Being able to negotiate multiple TCP
socket connections in both directions at the same time allows a single physical network
interface, such as ethernet, to be multiplexed to transfer multiple streams of TCP data
simultaneously. Below is a (very) simplified diagram of the TCP 3-way handshake
process.
Have a look at the diagram on the right as you examine the list of events on the left.
Synchronize and Acknowledge messages are indicated by a either the SYN bit, or the ACK bit
inside the TCP header, and the SYN-ACK message has both the SYN and the ACK bits
turned on (set to 1) in the TCP header. TCP knows whether the network TCP socket
connection
is opening, synchronizing, established by using the Synchronize and Acknowledge
messages
when establishing a network TCP socket connection.
When the communication between two computers ends, another 3-way communication is
performed to tear down the TCP socket connection. This setup and teardown of a TCP
socket
connection is part of what qualifies TCP a reliable protocol. TCP also acknowledges that
data is successfully received and guarantees the data is reassembled in the correct order.
Note that UDP is connectionless. That means UDP doesn't establish connections as TCP
does, so UDP does not perform this 3-way handshake and for this reason, it is referred to
as an unreliable protocol. That doesn't mean UDP can't transfer data, it just doesn't
negotiate how the connection will work, UDP just transmits and hopes for the best.
Q 5: How does BGP work? How does it solve the Count to Infinity problem?
Ans:
www.IGNOUHelp.in
BGP: The Exterior Gateway Routing Protocol
The purpose of Border Gateway Protocol is to enable two different ASes to exchange
routing
information so that, IP traffic can flow across the AS border. A different protocol is needed
between the ASes because the objectives of an interior gateway and exterior gateway routing
protocol are different. Exterior gateway routing protocol such as BGP is related to
policy matters. BGP is fundamentally a distance vector protocol but, it is more
appropriately characterised as path vector protocol.
Instead of maintaining just the cost to each destination, each BGP router keeps track of
the path used .Neighbouring BGP routers, known as BGP peers exchange detailed information
along with
the list of ASes on a path to a given destination rather than record cost information.
The main advantage of using BGP is to solve the count to infinity problem which is
illustrated.
www.IGNOUHelp.in
suppose C crashes or the line B-C is down.
Then if B receives, two routes from its 2 neighbours: ABCDK and FBCDK, then these
which
can be rejected because it passes through C itself. Other distance vector algorithms make
the wrong choice because, they cannot tell which of their neighbours have independent routes to
their destination or not.
Q 6: Explain Diffie Hellman algorithm-with the help of an example.
Ans:
Diffie-Hellman is a commonly used public-key algorithm for key exchange. It is generally
considered to be secure when sufficiently long keys and proper generators are used. The
security of Diffie-Hellman relies on the difficulty of the discrete logarithm problem (which
is believed to be computationally equivalent to factoring large integers). Diffie-Hellman is claimed to
be patented in the United States, but the patent expired on April 29, 1997. There are also
strong rumours that the patent might in fact be invalid (there is evidence of it
having been published over an year before the patent application was led). Diffie-Hellman is
sensitive to the selection of the strong prime, size of the secret exponent, and the generator.
The “Diffie-Hellman Method For Key Agreement” allow two hosts to create and share a
secret
key.
1) First the hosts must get the “Diffie-Hellman parameters”. A prime number, „p‟ (larger
than 2) and “base”, „g‟, an integer that is smaller than „p‟. They can either be hard coded or
fetched from a server.
2) The hosts each secretly generate a private number called „x‟, which is less than “p – 1”.
3) The hosts next generate the public keys, „y‟. They are created with the function:
y = g^x % p
4) The two host now exchange the public keys („y‟) and the exchanged numbers
are converted
into a secret key,
„z‟. z = y^x % p
„z‟ can now be used as the key for whatever encryption method is used to transfer
information between the two hosts. Mathematically, the two hosts should have generated
the same value for „z‟.
www.IGNOUHelp.in
z = (g^x % p)^x' % p = (g^x' % p)^x % p
All of these numbers are positive integers
x^y means: x is raised to the y power
x%y means: x is divided by y and the remainder is
returned Example:
Prime Number p = 353 and primitive root of 353, in this case is g = 3. Let A is sender B is
receives A & B select secret key as XA = 97 and XB = 233. Now A & B computes their
public keys. YA = 3233. Now A & B computes their public
keys. YA = 397 mod 353 = 40
YB = 3233 mod 353 = 248
After exchanging their public keys, A & B can compute the common secret key:
A computes:
Z=(YB) mod 253
B computes = 24897 mod 353 = 160
Z = (YA)xbmod353 = 40233 mod 353 = 160
www.IGNOUHelp.in
• CA‟s digital signature.
www.IGNOUHelp.in
Ans:
An important difference between two traffic shaping algorithms: token bucket throws
away
tokens when the bucket is full but never discards packets while leaky bucket discards
packets when the bucket is full. Unlike leaky bucket, token bucket allows saving, up to
maximum size of bucket n. This means that bursts of up to n packets can be sent at once, giving
faster response to sudden bursts of input. Leaky bucket forces bursty traffic to smooth out, token
bucket permits burstiness but bounds it. Token bucket has no discard or priority policy. Token
bucket when
compared to leaky bucket, is easy to implement. Each flow needs just a counter to
count tokens and a timer to determine when to add new tokens to the counter.
A token bucket flow is defined by (r,b), r denotes the rate at which tokens(credits)
are accumulated and b is the depth of the token pool(in bytes).
r
tokens/sec
Packets
remove
Token
token
To network
wait
As it shown above the new token are adding to the bucket at rate of r tokens/sec, the
maximum token can be accumulated is b bytes. If the bucket is full, the incoming tokens will be
thrown
www.IGNOUHelp.in
away. The Token Bucket(TB) profile contains three parameters: an average rate, a
peak rate, and burst size.
Because of their awareness of media types and other factors, link state protocols require
more processing power (more circuit logic in the case of ASICs) and memory. Distance
vector algorithms being simpler require simpler hardware.
A Comparison: Link State vs. Distance Vector
See Fig. 1-1 below. If all routers were running a Distance Vector protocol, the path or
'route' chosen would be from A B directly over the ISDN serial link, even though that
link is about 10 times slower than the indirect route from A C D B.
A Link State protocol would choose the A C D B path because it's using a faster
medium (100 Mb ethernet). In this example, it would be better to run a Link State routing
protocol, but if all the links in the network are the same speed, then a Distance Vector
protocol is better.
https://www.facebook.com/IGNOUHelp.in
------------------------------------------------- THE END
-----------------------------------------------------