CS4150 Lab 7-Socket Programming and Hamming Codes Solved

35.00 $

Description

5/5 - (4 votes)

(Socket Programming and Hamming Codes)

1. Virtual network for this lab has 3 VMs namely h1 (192.168.1.1) , h2 (192.168.1.2), and h3 (192.168.1.3).

On machine h1 write a program called client that takes two argument S and m; the first argument is a string, and the second argument is an integer. The program should output the binary (8-bit per character) of the string S. The program should then frame and code this data using a (m + r, m) Hamming code (r should be the least possible for the given number of message bits m). Each Hamming code should be sent as a UDP packet to port X of h2, where X ∈ [8560,8570]. h2 will introduce a random 1-bit error in each Hamming code it receives and will then send the modified code to port Y of h3.

On h3, write a program called server that accepts codes with 1-bit error sent by h2, corrects the error, assembles all the corrected codes together to obtain string S, prints S with a newline and waits for the next string. The division of marks for this lab is as follows.

  1. (a)  Sending a binary string from h1 and receiving the 1-bit error binary string at h3. [25]
  2. (b)  Encoding and correcting errors using Hamming codes. [25]
  3. (c)  Padding, pre-coding and framing. [25]

(d) Encoding S as a binary character array at h1 and recovering it at h3, printing S along with a new line at h3 and waiting for the next string.

  • lab7-wrdds3.zip