Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Modify the client and server code (links given below) to include services provided by Go-Back-N protocol. Cilent Code: import socket import sys # Create a
Modify the client and server code (links given below) to include services provided by Go-Back-N protocol.
Cilent Code:
import socket import sys # Create a UDP socket sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) server_address = ('localhost', 10000) message = '0' #'This is the message. It will be repeated.' try: # Send data print >>sys.stderr, 'sending "%s"' % message sent = sock.sendto(message, server_address) # Receive response print >>sys.stderr, 'waiting to receive' data, server = sock.recvfrom(4096) print >>sys.stderr, 'I have to send "%s"' % data while str(data) != '9': message = data sent = sock.sendto(message, server_address) data, server = sock.recvfrom(4096) print >>sys.stderr, 'I have to send "%s"' % data finally: print >>sys.stderr, 'closing socket' raw_input() sock.close()
Server Code:
import socket import sys # Create a TCP/IP socket sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # Bind the socket to the port server_address = ('localhost', 10000) print >>sys.stderr, 'starting up on %s port %s' % server_address sock.bind(server_address) while True: print >>sys.stderr, ' waiting to receive message' data, address = sock.recvfrom(4096) print >>sys.stderr, 'received %s bytes from %s' % (len(data), address) print >>sys.stderr, data m = ord(data) + 1 if data: sent = sock.sendto(chr(m), address) print >>sys.stderr, 'sent %s bytes back to %s' % (sent, address)
Whats needed:
a. flowchart of your implementation
b. brief description of the functions that you write
c. an output which demonstrates at least 10 successful frame transmissions A to B with corruption rate and loss rate of 0.2.
d. screenshots of the output for both client and server
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started